diff --git a/lib/Activity.php b/lib/Activity.php index 92fee3fc..73adae07 100644 --- a/lib/Activity.php +++ b/lib/Activity.php @@ -54,12 +54,10 @@ class Activity implements \OCP\Activity\IExtension { const SUBJECT_ITEM_RENAMED_SELF = 'item_renamed_self'; - protected $URLGenerator; - protected $factory; - - public function __construct(IURLGenerator $URLGenerator, IFactory $factory) { - $this->URLGenerator = $URLGenerator; - $this->factory = $factory; + public function __construct( + protected IURLGenerator $URLGenerator, + protected IFactory $factory, + ) { } diff --git a/lib/BackgroundJob/ExpireCredentials.php b/lib/BackgroundJob/ExpireCredentials.php index d8201a86..a0b43144 100644 --- a/lib/BackgroundJob/ExpireCredentials.php +++ b/lib/BackgroundJob/ExpireCredentials.php @@ -42,7 +42,11 @@ class ExpireCredentials extends TimedJob { * @param IConfig $config * @param CronService $cronService */ - public function __construct(ITimeFactory $timeFactory, protected IConfig $config, private CronService $cronService) { + public function __construct( + ITimeFactory $timeFactory, + protected IConfig $config, + private CronService $cronService, + ) { parent::__construct($timeFactory); // Run once per minute diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php index 16425f51..6ea16b0d 100644 --- a/lib/Controller/AdminController.php +++ b/lib/Controller/AdminController.php @@ -29,24 +29,18 @@ use OCP\IUserManager; class AdminController extends ApiController { private $userId; - private $vaultService; - private $credentialService; - private $fileService; - private $revisionService; - private $deleteVaultRequestService; - private $config; - private $userManager; - public function __construct($AppName, - IRequest $request, - $UserId, - VaultService $vaultService, - CredentialService $credentialService, - FileService $fileService, - CredentialRevisionService $revisionService, - DeleteVaultRequestService $deleteVaultRequestService, - IConfig $config, - IUserManager $userManager + public function __construct( + $AppName, + IRequest $request, + $UserId, + private VaultService $vaultService, + private CredentialService $credentialService, + private FileService $fileService, + private CredentialRevisionService $revisionService, + private DeleteVaultRequestService $deleteVaultRequestService, + private IConfig $config, + private IUserManager $userManager, ) { parent::__construct( $AppName, @@ -55,14 +49,7 @@ class AdminController extends ApiController { 'Authorization, Content-Type, Accept', 86400); $this->userId = $UserId; - $this->vaultService = $vaultService; - $this->credentialService = $credentialService; - $this->fileService = $fileService; - $this->revisionService = $revisionService; - $this->deleteVaultRequestService = $deleteVaultRequestService; - $this->config = $config; - $this->userManager = $userManager; } diff --git a/lib/Controller/CredentialController.php b/lib/Controller/CredentialController.php index cdb23bcb..9cfefa8a 100644 --- a/lib/Controller/CredentialController.php +++ b/lib/Controller/CredentialController.php @@ -29,21 +29,16 @@ use OCP\IRequest; class CredentialController extends ApiController { private $userId; - private $credentialService; - private $activityService; - private $credentialRevisionService; - private $sharingService; - private $settings; - - public function __construct($AppName, - IRequest $request, - $userId, - CredentialService $credentialService, - ActivityService $activityService, - CredentialRevisionService $credentialRevisionService, - ShareService $sharingService, - SettingsService $settings + public function __construct( + $AppName, + IRequest $request, + $userId, + private CredentialService $credentialService, + private ActivityService $activityService, + private CredentialRevisionService $credentialRevisionService, + private ShareService $sharingService, + private SettingsService $settings, ) { parent::__construct( $AppName, @@ -52,11 +47,6 @@ class CredentialController extends ApiController { 'Authorization, Content-Type, Accept', 86400); $this->userId = $userId; - $this->credentialService = $credentialService; - $this->activityService = $activityService; - $this->credentialRevisionService = $credentialRevisionService; - $this->sharingService = $sharingService; - $this->settings = $settings; } diff --git a/lib/Controller/FileController.php b/lib/Controller/FileController.php index 0222b54e..8655fba0 100644 --- a/lib/Controller/FileController.php +++ b/lib/Controller/FileController.php @@ -19,14 +19,14 @@ use Psr\Log\LoggerInterface; class FileController extends ApiController { private $userId; - private $fileService; - private $logger; - public function __construct($AppName, - IRequest $request, - $UserId, - FileService $fileService, - LoggerInterface $logger) { + public function __construct( + $AppName, + IRequest $request, + $UserId, + private FileService $fileService, + private LoggerInterface $logger, + ) { parent::__construct( $AppName, $request, @@ -34,8 +34,6 @@ class FileController extends ApiController { 'Authorization, Content-Type, Accept', 86400); $this->userId = $UserId; - $this->fileService = $fileService; - $this->logger = $logger; } diff --git a/lib/Controller/IconController.php b/lib/Controller/IconController.php index 0bf9d221..0a9c23e5 100644 --- a/lib/Controller/IconController.php +++ b/lib/Controller/IconController.php @@ -25,17 +25,15 @@ use OCP\IURLGenerator; class IconController extends ApiController { private $userId; - private $credentialService; - private $am; - private $urlGenerator; const ICON_CACHE_OFFSET = 2592000; // 3600 * 24 * 30 - public function __construct($AppName, - IRequest $request, - $UserId, - CredentialService $credentialService, - AppManager $am, - IURLGenerator $urlGenerator + public function __construct( + $AppName, + IRequest $request, + $UserId, + private CredentialService $credentialService, + private AppManager $am, + private IURLGenerator $urlGenerator, ) { parent::__construct( $AppName, @@ -44,9 +42,6 @@ class IconController extends ApiController { 'Authorization, Content-Type, Accept', 86400); $this->userId = $UserId; - $this->credentialService = $credentialService; - $this->am = $am; - $this->urlGenerator = $urlGenerator; } diff --git a/lib/Controller/InternalController.php b/lib/Controller/InternalController.php index 44a8dc04..f06f4939 100644 --- a/lib/Controller/InternalController.php +++ b/lib/Controller/InternalController.php @@ -21,18 +21,15 @@ use OCP\Notification\IManager; class InternalController extends ApiController { private $userId; - private $credentialService; - private $config; - private $manager; - private $appManager; - public function __construct($AppName, - IRequest $request, - $UserId, - CredentialService $credentialService, - IConfig $config, - IManager $IManager, - IAppManager $appManager + public function __construct( + $AppName, + IRequest $request, + $UserId, + private CredentialService $credentialService, + private IConfig $config, + private IManager $manager, + private IAppManager $appManager, ) { parent::__construct( $AppName, @@ -41,10 +38,6 @@ class InternalController extends ApiController { 'Authorization, Content-Type, Accept', 86400); $this->userId = $UserId; - $this->credentialService = $credentialService; - $this->config = $config; - $this->manager = $IManager; - $this->appManager = $appManager; } /** diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 875a105d..1c97b882 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -19,24 +19,20 @@ use OCP\IL10N; use OCP\IRequest; class SettingsController extends ApiController { - private $userId; - private $settings; public function __construct( $AppName, IRequest $request, - $userId, - SettingsService $settings, - IL10N $l) { + private $userId, + private SettingsService $settings, + private IL10N $l, + ) { parent::__construct( $AppName, $request, 'GET, POST, DELETE, PUT, PATCH, OPTIONS', 'Authorization, Content-Type, Accept', 86400); - $this->settings = $settings; - $this->l = $l; - $this->userId = $userId; } /** diff --git a/lib/Controller/ShareController.php b/lib/Controller/ShareController.php index 5c5fd725..91883249 100644 --- a/lib/Controller/ShareController.php +++ b/lib/Controller/ShareController.php @@ -36,33 +36,24 @@ use OCP\Notification\IManager; class ShareController extends ApiController { private $userId; - private $activityService; - private $groupManager; - private $userManager; - private $vaultService; - private $shareService; - private $credentialService; - private $notificationService; - private $fileService; - private $settings; - private $manager; private $limit = 50; private $offset = 0; - public function __construct($AppName, - IRequest $request, - $UserId, - IGroupManager $groupManager, - IUserManager $userManager, - ActivityService $activityService, - VaultService $vaultService, - ShareService $shareService, - CredentialService $credentialService, - NotificationService $notificationService, - FileService $fileService, - SettingsService $config, - IManager $IManager + public function __construct( + $AppName, + IRequest $request, + $UserId, + private IGroupManager $groupManager, + private IUserManager $userManager, + private ActivityService $activityService, + private VaultService $vaultService, + private ShareService $shareService, + private CredentialService $credentialService, + private NotificationService $notificationService, + private FileService $fileService, + private SettingsService $settings, + private IManager $manager, ) { parent::__construct( $AppName, @@ -72,16 +63,6 @@ class ShareController extends ApiController { 86400); $this->userId = $UserId; - $this->userManager = $userManager; - $this->groupManager = $groupManager; - $this->activityService = $activityService; - $this->vaultService = $vaultService; - $this->shareService = $shareService; - $this->credentialService = $credentialService; - $this->notificationService = $notificationService; - $this->fileService = $fileService; - $this->settings = $config; - $this->manager = $IManager; } diff --git a/lib/Controller/TranslationController.php b/lib/Controller/TranslationController.php index 4b6fc6a8..40533bd4 100644 --- a/lib/Controller/TranslationController.php +++ b/lib/Controller/TranslationController.php @@ -17,11 +17,11 @@ use OCP\IL10N; use OCP\IRequest; class TranslationController extends ApiController { - private $trans; - public function __construct($AppName, - IRequest $request, - IL10N $trans + public function __construct( + $AppName, + IRequest $request, + private IL10N $trans, ) { parent::__construct( $AppName, @@ -29,7 +29,6 @@ class TranslationController extends ApiController { 'GET, POST, DELETE, PUT, PATCH, OPTIONS', 'Authorization, Content-Type, Accept', 86400); - $this->trans = $trans; } diff --git a/lib/Controller/VaultController.php b/lib/Controller/VaultController.php index 25e4c992..f29e4914 100644 --- a/lib/Controller/VaultController.php +++ b/lib/Controller/VaultController.php @@ -26,22 +26,18 @@ use Psr\Log\LoggerInterface; class VaultController extends ApiController { private $userId; - private $vaultService; - private $credentialService; - private $settings; - private $fileService; - private $logger; - private $deleteVaultRequestService; - public function __construct($AppName, - IRequest $request, - $UserId, - VaultService $vaultService, - CredentialService $credentialService, - DeleteVaultRequestService $deleteVaultRequestService, - SettingsService $settings, - FileService $fileService, - LoggerInterface $logger) { + public function __construct( + $AppName, + IRequest $request, + $UserId, + private VaultService $vaultService, + private CredentialService $credentialService, + private DeleteVaultRequestService $deleteVaultRequestService, + private SettingsService $settings, + private FileService $fileService, + private LoggerInterface $logger, + ) { parent::__construct( $AppName, $request, @@ -49,12 +45,6 @@ class VaultController extends ApiController { 'Authorization, Content-Type, Accept', 86400); $this->userId = $UserId; - $this->vaultService = $vaultService; - $this->credentialService = $credentialService; - $this->deleteVaultRequestService = $deleteVaultRequestService; - $this->settings = $settings; - $this->fileService = $fileService; - $this->logger = $logger; } /** diff --git a/lib/Db/CredentialMapper.php b/lib/Db/CredentialMapper.php index e1455842..25787419 100644 --- a/lib/Db/CredentialMapper.php +++ b/lib/Db/CredentialMapper.php @@ -33,11 +33,12 @@ use OCP\IDBConnection; class CredentialMapper extends QBMapper { const TABLE_NAME = 'passman_credentials'; - private Utils $utils; - public function __construct(IDBConnection $db, Utils $utils) { + public function __construct( + IDBConnection $db, + private Utils $utils, + ) { parent::__construct($db, self::TABLE_NAME); - $this->utils = $utils; } diff --git a/lib/Db/FileMapper.php b/lib/Db/FileMapper.php index bb590163..6e33a3ed 100644 --- a/lib/Db/FileMapper.php +++ b/lib/Db/FileMapper.php @@ -34,11 +34,12 @@ use OCP\IDBConnection; class FileMapper extends QBMapper { const TABLE_NAME = 'passman_files'; - private Utils $utils; - public function __construct(IDBConnection $db, Utils $utils) { + public function __construct( + IDBConnection $db, + private Utils $utils, + ) { parent::__construct($db, self::TABLE_NAME); - $this->utils = $utils; } diff --git a/lib/Db/VaultMapper.php b/lib/Db/VaultMapper.php index 37fb942c..e35356d4 100644 --- a/lib/Db/VaultMapper.php +++ b/lib/Db/VaultMapper.php @@ -33,11 +33,12 @@ use OCP\IDBConnection; class VaultMapper extends QBMapper { const TABLE_NAME = 'passman_vaults'; - private Utils $utils; - public function __construct(IDBConnection $db, Utils $utils) { + public function __construct( + IDBConnection $db, + private Utils $utils, + ) { parent::__construct($db, self::TABLE_NAME); - $this->utils = $utils; } diff --git a/lib/Middleware/APIMiddleware.php b/lib/Middleware/APIMiddleware.php index d099868f..92f3cc17 100644 --- a/lib/Middleware/APIMiddleware.php +++ b/lib/Middleware/APIMiddleware.php @@ -9,10 +9,9 @@ use OCP\IRequest; class APIMiddleware extends Middleware { - private $request; - - public function __construct(IRequest $request) { - $this->request = $request; + public function __construct( + private IRequest $request, + ) { } public function afterController($controller, $methodName, Response $response) { diff --git a/lib/Migration/ServerSideEncryption.php b/lib/Migration/ServerSideEncryption.php index a41e7c0c..c257b851 100644 --- a/lib/Migration/ServerSideEncryption.php +++ b/lib/Migration/ServerSideEncryption.php @@ -39,35 +39,18 @@ use Psr\Log\LoggerInterface; class ServerSideEncryption implements IRepairStep { - /** @var EncryptService */ - private $encryptService; - - /** @var IDBConnection */ - private $db; - /** @var string */ private $installedVersion; - /** @var LoggerInterface */ - private $logger; - - /** @var CredentialService */ - private $credentialService; - - /** @var CredentialRevisionService */ - private $revisionService; - - /** @var FileService */ - private $fileService; - - public function __construct(EncryptService $encryptService, IDBConnection $db, LoggerInterface $logger, CredentialService $credentialService, CredentialRevisionService $revisionService, - FileService $fileService, IConfig $config) { - $this->encryptService = $encryptService; - $this->db = $db; - $this->logger = $logger; - $this->credentialService = $credentialService; - $this->revisionService = $revisionService; - $this->fileService = $fileService; + public function __construct( + private EncryptService $encryptService, + private IDBConnection $db, + private LoggerInterface $logger, + private CredentialService $credentialService, + private CredentialRevisionService $revisionService, + private FileService $fileService, + IConfig $config, + ) { $this->installedVersion = $config->getAppValue('passman', 'installed_version'); } diff --git a/lib/Migration/Version02031335Date20211001122343.php b/lib/Migration/Version02031335Date20211001122343.php index 4d738fd5..78aad260 100644 --- a/lib/Migration/Version02031335Date20211001122343.php +++ b/lib/Migration/Version02031335Date20211001122343.php @@ -15,9 +15,6 @@ use OCP\Migration\SimpleMigrationStep; */ class Version02031335Date20211001122343 extends SimpleMigrationStep { - /** @var IDBConnection */ - protected $connection; - protected $oldColumn = 'favicon'; protected $newColumn = 'icon'; protected $dataMigrationRequired = false; @@ -25,8 +22,9 @@ class Version02031335Date20211001122343 extends SimpleMigrationStep { /** * @param IDBConnection $connection */ - public function __construct(IDBConnection $connection) { - $this->connection = $connection; + public function __construct( + protected IDBConnection $connection, + ) { } /** diff --git a/lib/Notifier.php b/lib/Notifier.php index 38b3a8a8..d5beddec 100644 --- a/lib/Notifier.php +++ b/lib/Notifier.php @@ -29,10 +29,9 @@ use OCP\Notification\INotifier; class Notifier implements INotifier { - protected IFactory $factory; - - public function __construct(IFactory $factory) { - $this->factory = $factory; + public function __construct( + protected IFactory $factory, + ) { } /** diff --git a/lib/Search/Provider.php b/lib/Search/Provider.php index de98c4bc..cac452e3 100644 --- a/lib/Search/Provider.php +++ b/lib/Search/Provider.php @@ -42,16 +42,13 @@ use OCP\Search\SearchResultEntry; class Provider implements IProvider { - private IL10N $l10n; - private IURLGenerator $urlGenerator; - private IDBConnection $db; - private SettingsService $settings; + public function __construct( + private IL10N $l10n, + private IURLGenerator $urlGenerator, + private IDBConnection $db, + private SettingsService $settings, + ) { - public function __construct(IL10N $l10n, IURLGenerator $urlGenerator, IDBConnection $db, SettingsService $settings) { - $this->l10n = $l10n; - $this->urlGenerator = $urlGenerator; - $this->db = $db; - $this->settings = $settings; } public function getId(): string { diff --git a/lib/Service/CredentialRevisionService.php b/lib/Service/CredentialRevisionService.php index 035c4dd1..83072bb6 100644 --- a/lib/Service/CredentialRevisionService.php +++ b/lib/Service/CredentialRevisionService.php @@ -33,13 +33,13 @@ use OCP\IConfig; class CredentialRevisionService { - private CredentialRevisionMapper $credentialRevisionMapper; - private EncryptService $encryptService; private $server_key; - public function __construct(CredentialRevisionMapper $credentialRevisionMapper, EncryptService $encryptService, IConfig $config) { - $this->credentialRevisionMapper = $credentialRevisionMapper; - $this->encryptService = $encryptService; + public function __construct( + private CredentialRevisionMapper $credentialRevisionMapper, + private EncryptService $encryptService, + IConfig $config, + ) { $this->server_key = $config->getSystemValue('passwordsalt', ''); } diff --git a/lib/Service/CredentialService.php b/lib/Service/CredentialService.php index feb6c773..5b902b77 100644 --- a/lib/Service/CredentialService.php +++ b/lib/Service/CredentialService.php @@ -36,27 +36,17 @@ use OCP\IConfig; class CredentialService { - private CredentialMapper $credentialMapper; - private SharingACLMapper $sharingACL; - private ActivityService $activityService; - private ShareService $shareService; - private EncryptService $encryptService; - private CredentialRevisionService $credentialRevisionService; private $server_key; - public function __construct(CredentialMapper $credentialMapper, - SharingACLMapper $sharingACL, - ActivityService $activityService, - ShareService $shareService, - EncryptService $encryptService, - CredentialRevisionService $credentialRevisionService, - IConfig $config) { - $this->credentialMapper = $credentialMapper; - $this->sharingACL = $sharingACL; - $this->activityService = $activityService; - $this->shareService = $shareService; - $this->encryptService = $encryptService; - $this->credentialRevisionService = $credentialRevisionService; + public function __construct( + private CredentialMapper $credentialMapper, + private SharingACLMapper $sharingACL, + private ActivityService $activityService, + private ShareService $shareService, + private EncryptService $encryptService, + private CredentialRevisionService $credentialRevisionService, + IConfig $config, + ) { $this->server_key = $config->getSystemValue('passwordsalt', ''); } diff --git a/lib/Service/CronService.php b/lib/Service/CronService.php index b820b9ad..058e961b 100644 --- a/lib/Service/CronService.php +++ b/lib/Service/CronService.php @@ -32,20 +32,14 @@ use Psr\Log\LoggerInterface; class CronService { - private CredentialService $credentialService; - private LoggerInterface $logger; - private Utils $utils; - private NotificationService $notificationService; - private ActivityService $activityService; - private IDBConnection $db; - - public function __construct(CredentialService $credentialService, LoggerInterface $logger, Utils $utils, NotificationService $notificationService, ActivityService $activityService, IDBConnection $db) { - $this->credentialService = $credentialService; - $this->logger = $logger; - $this->utils = $utils; - $this->notificationService = $notificationService; - $this->activityService = $activityService; - $this->db = $db; + public function __construct( + private CredentialService $credentialService, + private LoggerInterface $logger, + private Utils $utils, + private NotificationService $notificationService, + private ActivityService $activityService, + private IDBConnection $db, + ) { } public function expireCredentials() { diff --git a/lib/Service/DeleteVaultRequestService.php b/lib/Service/DeleteVaultRequestService.php index 872111c5..2e98c6f0 100644 --- a/lib/Service/DeleteVaultRequestService.php +++ b/lib/Service/DeleteVaultRequestService.php @@ -30,10 +30,9 @@ use OCP\AppFramework\Db\Entity; class DeleteVaultRequestService { - private DeleteVaultRequestMapper $deleteVaultRequestMapper; - - public function __construct(DeleteVaultRequestMapper $deleteVaultRequestMapper) { - $this->deleteVaultRequestMapper = $deleteVaultRequestMapper; + public function __construct( + private DeleteVaultRequestMapper $deleteVaultRequestMapper, + ) { } /** diff --git a/lib/Service/FileService.php b/lib/Service/FileService.php index e411abc5..5a8e4bb7 100644 --- a/lib/Service/FileService.php +++ b/lib/Service/FileService.php @@ -34,13 +34,13 @@ use OCP\IConfig; class FileService { - private FileMapper $fileMapper; - private EncryptService $encryptService; private $server_key; - public function __construct(FileMapper $fileMapper, EncryptService $encryptService, IConfig $config) { - $this->fileMapper = $fileMapper; - $this->encryptService = $encryptService; + public function __construct( + private FileMapper $fileMapper, + private EncryptService $encryptService, + IConfig $config, + ) { $this->server_key = $config->getSystemValue('passwordsalt', ''); } diff --git a/lib/Service/NotificationService.php b/lib/Service/NotificationService.php index 5b0d2d8d..debbe2ca 100644 --- a/lib/Service/NotificationService.php +++ b/lib/Service/NotificationService.php @@ -28,13 +28,10 @@ use OCP\IURLGenerator; use OCP\Notification\IManager; class NotificationService { - - private IManager $manager; - private IURLGenerator $urlGenerator; - - public function __construct(IManager $IManager, IURLGenerator $urlGenerator) { - $this->manager = $IManager; - $this->urlGenerator = $urlGenerator; + public function __construct( + private IManager $manager, + private IURLGenerator $urlGenerator, + ) { } function credentialExpiredNotification($credential) { diff --git a/lib/Service/SettingsService.php b/lib/Service/SettingsService.php index a87ff9ba..fa20d20c 100644 --- a/lib/Service/SettingsService.php +++ b/lib/Service/SettingsService.php @@ -29,7 +29,6 @@ use OCP\IConfig; class SettingsService { private $userId; - private $config; private $appName; public $settings; @@ -44,9 +43,12 @@ class SettingsService { 'settings_loaded' ]; - public function __construct($UserId, IConfig $config, $AppName) { + public function __construct( + $UserId, + private IConfig $config, + $AppName, + ) { $this->userId = $UserId; - $this->config = $config; $this->appName = $AppName; $this->settings = [ 'link_sharing_enabled' => intval($this->config->getAppValue('passman', 'link_sharing_enabled', 1)), diff --git a/lib/Service/ShareService.php b/lib/Service/ShareService.php index 2f1034e3..4db20777 100644 --- a/lib/Service/ShareService.php +++ b/lib/Service/ShareService.php @@ -38,28 +38,14 @@ use OCP\DB\IResult; use OCP\Notification\IManager; class ShareService { - private SharingACLMapper $sharingACL; - private ShareRequestMapper $shareRequest; - private CredentialMapper $credential; - private CredentialRevisionService $revisions; - private EncryptService $encryptService; - private IManager $IManager; - - public function __construct( - SharingACLMapper $sharingACL, - ShareRequestMapper $shareRequest, - CredentialMapper $credentials, - CredentialRevisionService $revisions, - EncryptService $encryptService, - IManager $IManager + private SharingACLMapper $sharingACL, + private ShareRequestMapper $shareRequest, + private CredentialMapper $credential, + private CredentialRevisionService $revisions, + private EncryptService $encryptService, + private IManager $IManager, ) { - $this->sharingACL = $sharingACL; - $this->shareRequest = $shareRequest; - $this->credential = $credentials; - $this->revisions = $revisions; - $this->encryptService = $encryptService; - $this->IManager = $IManager; } /** diff --git a/lib/Service/VaultService.php b/lib/Service/VaultService.php index 4c0d5c20..7687d199 100644 --- a/lib/Service/VaultService.php +++ b/lib/Service/VaultService.php @@ -32,10 +32,10 @@ use OCP\AppFramework\Db\MultipleObjectsReturnedException; class VaultService { - private $vaultMapper; + public function __construct( + private VaultMapper $vaultMapper, + ) { - public function __construct(VaultMapper $vaultMapper) { - $this->vaultMapper = $vaultMapper; } /** diff --git a/lib/Settings/Admin.php b/lib/Settings/Admin.php index 283619fe..ec7cb60a 100644 --- a/lib/Settings/Admin.php +++ b/lib/Settings/Admin.php @@ -33,22 +33,18 @@ use Psr\Log\LoggerInterface; class Admin implements ISettings { - protected IConfig $config; - private IL10N $l; - private IAppManager $appManager; - private LoggerInterface $logger; - /** * Admin constructor. * @param IConfig $config * @param IL10N $l * @param IAppManager $appManager */ - public function __construct(IConfig $config, IL10N $l, IAppManager $appManager, LoggerInterface $logger) { - $this->config = $config; - $this->l = $l; - $this->appManager = $appManager; - $this->logger = $logger; + public function __construct( + protected IConfig $config, + private IL10N $l, + private IAppManager $appManager, + private LoggerInterface $logger, + ) { } /**