From a51d66636f92454ce5787ee5fec34eb835036533 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Mon, 14 Oct 2024 08:16:25 +0200 Subject: [PATCH 1/2] fix: Properly call parent constructor for remote activity job Signed-off-by: Julius Knorr --- lib/BackgroundJob/RemoteActivity.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/BackgroundJob/RemoteActivity.php b/lib/BackgroundJob/RemoteActivity.php index 03bd57b37..61e896afb 100644 --- a/lib/BackgroundJob/RemoteActivity.php +++ b/lib/BackgroundJob/RemoteActivity.php @@ -8,6 +8,7 @@ use GuzzleHttp\Exception\ClientException; use OCA\Activity\Extension\Files; +use OCP\AppFramework\Utility\ITimeFactory; use OCP\BackgroundJob\QueuedJob; use OCP\Federation\ICloudId; use OCP\Federation\ICloudIdManager; @@ -20,7 +21,8 @@ class RemoteActivity extends QueuedJob { /** @var ICloudIdManager */ protected $cloudIdManager; - public function __construct(IClientService $clientService, ICloudIdManager $cloudIdManager) { + public function __construct(ITimeFactory $timeFactory, IClientService $clientService, ICloudIdManager $cloudIdManager) { + parent::__construct($timeFactory); $this->clientService = $clientService; $this->cloudIdManager = $cloudIdManager; } From cc0ff113b83413b8c699a1527f5368e41db78b25 Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Mon, 14 Oct 2024 08:18:29 +0200 Subject: [PATCH 2/2] chore: Move to property promotion for RemoteActivity job Signed-off-by: Julius Knorr --- lib/BackgroundJob/RemoteActivity.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/BackgroundJob/RemoteActivity.php b/lib/BackgroundJob/RemoteActivity.php index 61e896afb..3df45eed0 100644 --- a/lib/BackgroundJob/RemoteActivity.php +++ b/lib/BackgroundJob/RemoteActivity.php @@ -15,16 +15,12 @@ use OCP\Http\Client\IClientService; class RemoteActivity extends QueuedJob { - /** @var IClientService */ - protected $clientService; - - /** @var ICloudIdManager */ - protected $cloudIdManager; - - public function __construct(ITimeFactory $timeFactory, IClientService $clientService, ICloudIdManager $cloudIdManager) { + public function __construct( + ITimeFactory $timeFactory, + private readonly IClientService $clientService, + private readonly ICloudIdManager $cloudIdManager, + ) { parent::__construct($timeFactory); - $this->clientService = $clientService; - $this->cloudIdManager = $cloudIdManager; } protected function run($argument) {