aboutsummaryrefslogtreecommitdiffstats
path: root/apps/lookup_server_connector/lib
diff options
context:
space:
mode:
authorprovokateurin <kate@provokateurin.de>2024-10-18 12:04:22 +0200
committerprovokateurin <kate@provokateurin.de>2024-10-21 12:37:59 +0200
commit381077028adf388a7081cf42026570c6be47b198 (patch)
treec0f8e9b6caea80d6b55d6fdcc9188ba57197fa0f /apps/lookup_server_connector/lib
parent4d8d11d2f79da348644e0902e78a2f000498cd52 (diff)
downloadnextcloud-server-381077028adf388a7081cf42026570c6be47b198.tar.gz
nextcloud-server-381077028adf388a7081cf42026570c6be47b198.zip
refactor(apps): Use constructor property promotion when possible
Signed-off-by: provokateurin <kate@provokateurin.de>
Diffstat (limited to 'apps/lookup_server_connector/lib')
-rw-r--r--apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php24
-rw-r--r--apps/lookup_server_connector/lib/UpdateLookupServer.php13
2 files changed, 13 insertions, 24 deletions
diff --git a/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php b/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php
index fd2a76b4773..1b0ca0fa576 100644
--- a/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php
+++ b/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php
@@ -19,11 +19,7 @@ use OCP\IUser;
use OCP\IUserManager;
class RetryJob extends Job {
- private IClientService $clientService;
private string $lookupServer;
- private IConfig $config;
- private IUserManager $userManager;
- private IAccountManager $accountManager;
private Signer $signer;
protected int $retries = 0;
protected bool $retainJob = false;
@@ -36,20 +32,18 @@ class RetryJob extends Job {
* @param IAccountManager $accountManager
* @param Signer $signer
*/
- public function __construct(ITimeFactory $time,
- IClientService $clientService,
- IConfig $config,
- IUserManager $userManager,
- IAccountManager $accountManager,
- Signer $signer) {
+ public function __construct(
+ ITimeFactory $time,
+ private IClientService $clientService,
+ private IConfig $config,
+ private IUserManager $userManager,
+ private IAccountManager $accountManager,
+ Signer $signer,
+ ) {
parent::__construct($time);
- $this->clientService = $clientService;
- $this->config = $config;
- $this->userManager = $userManager;
- $this->accountManager = $accountManager;
$this->signer = $signer;
- $this->lookupServer = $config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com');
+ $this->lookupServer = $this->config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com');
if (!empty($this->lookupServer)) {
$this->lookupServer = rtrim($this->lookupServer, '/');
$this->lookupServer .= '/users';
diff --git a/apps/lookup_server_connector/lib/UpdateLookupServer.php b/apps/lookup_server_connector/lib/UpdateLookupServer.php
index 9ccf149e12c..c689cea1fe0 100644
--- a/apps/lookup_server_connector/lib/UpdateLookupServer.php
+++ b/apps/lookup_server_connector/lib/UpdateLookupServer.php
@@ -19,19 +19,14 @@ use OCP\IUser;
* @package OCA\LookupServerConnector
*/
class UpdateLookupServer {
- /** @var IConfig */
- private $config;
- /** @var IJobList */
- private $jobList;
-
/**
* @param IJobList $jobList
* @param IConfig $config
*/
- public function __construct(IJobList $jobList,
- IConfig $config) {
- $this->config = $config;
- $this->jobList = $jobList;
+ public function __construct(
+ private IJobList $jobList,
+ private IConfig $config,
+ ) {
}
/**