diff options
author | Louis <6653109+artonge@users.noreply.github.com> | 2023-06-19 17:43:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-19 17:43:12 +0200 |
commit | 81bb3362b24a621fb399877739e7bff35ec13eb7 (patch) | |
tree | 96af2ea4177b42445cb64f10a6ff38500dde2680 /core/Command | |
parent | 98ea74bb40ca06979072ae657601283065c4ee50 (diff) | |
parent | d60bedfeeeca8f21fe148b4ec755144d31cc3704 (diff) | |
download | nextcloud-server-81bb3362b24a621fb399877739e7bff35ec13eb7.tar.gz nextcloud-server-81bb3362b24a621fb399877739e7bff35ec13eb7.zip |
Merge pull request #38767 from fsamapoor/constructor_property_promotion_in_core_command_part4
Uses PHP8's constructor property promotion in core/Command/Maintenance
Diffstat (limited to 'core/Command')
-rw-r--r-- | core/Command/Maintenance/DataFingerprint.php | 11 | ||||
-rw-r--r-- | core/Command/Maintenance/Install.php | 10 | ||||
-rw-r--r-- | core/Command/Maintenance/Mimetype/UpdateDB.php | 9 | ||||
-rw-r--r-- | core/Command/Maintenance/Mimetype/UpdateJS.php | 5 | ||||
-rw-r--r-- | core/Command/Maintenance/Mode.php | 7 | ||||
-rw-r--r-- | core/Command/Maintenance/Repair.php | 15 | ||||
-rw-r--r-- | core/Command/Maintenance/RepairShareOwnership.php | 9 | ||||
-rw-r--r-- | core/Command/Maintenance/UpdateTheme.php | 6 |
8 files changed, 23 insertions, 49 deletions
diff --git a/core/Command/Maintenance/DataFingerprint.php b/core/Command/Maintenance/DataFingerprint.php index a57dc307b18..3c15b95bc05 100644 --- a/core/Command/Maintenance/DataFingerprint.php +++ b/core/Command/Maintenance/DataFingerprint.php @@ -29,13 +29,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class DataFingerprint extends Command { - protected IConfig $config; - protected ITimeFactory $timeFactory; - - public function __construct(IConfig $config, - ITimeFactory $timeFactory) { - $this->config = $config; - $this->timeFactory = $timeFactory; + public function __construct( + protected IConfig $config, + protected ITimeFactory $timeFactory, + ) { parent::__construct(); } diff --git a/core/Command/Maintenance/Install.php b/core/Command/Maintenance/Install.php index efb99e51431..643bb54c0d6 100644 --- a/core/Command/Maintenance/Install.php +++ b/core/Command/Maintenance/Install.php @@ -47,13 +47,11 @@ use Throwable; use function get_class; class Install extends Command { - private SystemConfig $config; - private IniGetWrapper $iniGetWrapper; - - public function __construct(SystemConfig $config, IniGetWrapper $iniGetWrapper) { + public function __construct( + private SystemConfig $config, + private IniGetWrapper $iniGetWrapper, + ) { parent::__construct(); - $this->config = $config; - $this->iniGetWrapper = $iniGetWrapper; } protected function configure() { diff --git a/core/Command/Maintenance/Mimetype/UpdateDB.php b/core/Command/Maintenance/Mimetype/UpdateDB.php index edc42c0fdcd..212b1994263 100644 --- a/core/Command/Maintenance/Mimetype/UpdateDB.php +++ b/core/Command/Maintenance/Mimetype/UpdateDB.php @@ -35,16 +35,11 @@ use Symfony\Component\Console\Output\OutputInterface; class UpdateDB extends Command { public const DEFAULT_MIMETYPE = 'application/octet-stream'; - protected IMimeTypeDetector $mimetypeDetector; - protected IMimeTypeLoader $mimetypeLoader; - public function __construct( - IMimeTypeDetector $mimetypeDetector, - IMimeTypeLoader $mimetypeLoader + protected IMimeTypeDetector $mimetypeDetector, + protected IMimeTypeLoader $mimetypeLoader, ) { parent::__construct(); - $this->mimetypeDetector = $mimetypeDetector; - $this->mimetypeLoader = $mimetypeLoader; } protected function configure() { diff --git a/core/Command/Maintenance/Mimetype/UpdateJS.php b/core/Command/Maintenance/Mimetype/UpdateJS.php index 6a5a3d0ac61..71145907b9e 100644 --- a/core/Command/Maintenance/Mimetype/UpdateJS.php +++ b/core/Command/Maintenance/Mimetype/UpdateJS.php @@ -31,13 +31,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class UpdateJS extends Command { - protected IMimeTypeDetector $mimetypeDetector; - public function __construct( - IMimeTypeDetector $mimetypeDetector + protected IMimeTypeDetector $mimetypeDetector, ) { parent::__construct(); - $this->mimetypeDetector = $mimetypeDetector; } protected function configure() { diff --git a/core/Command/Maintenance/Mode.php b/core/Command/Maintenance/Mode.php index c2af33aa4ed..685c2fa0837 100644 --- a/core/Command/Maintenance/Mode.php +++ b/core/Command/Maintenance/Mode.php @@ -33,10 +33,9 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class Mode extends Command { - protected IConfig $config; - - public function __construct(IConfig $config) { - $this->config = $config; + public function __construct( + protected IConfig $config, + ) { parent::__construct(); } diff --git a/core/Command/Maintenance/Repair.php b/core/Command/Maintenance/Repair.php index a1d97476f94..6c40ca2820f 100644 --- a/core/Command/Maintenance/Repair.php +++ b/core/Command/Maintenance/Repair.php @@ -47,19 +47,16 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class Repair extends Command { - protected \OC\Repair $repair; - protected IConfig $config; - private IEventDispatcher $dispatcher; private ProgressBar $progress; private OutputInterface $output; - private IAppManager $appManager; protected bool $errored = false; - public function __construct(\OC\Repair $repair, IConfig $config, IEventDispatcher $dispatcher, IAppManager $appManager) { - $this->repair = $repair; - $this->config = $config; - $this->dispatcher = $dispatcher; - $this->appManager = $appManager; + public function __construct( + protected \OC\Repair $repair, + protected IConfig $config, + private IEventDispatcher $dispatcher, + private IAppManager $appManager, + ) { parent::__construct(); } diff --git a/core/Command/Maintenance/RepairShareOwnership.php b/core/Command/Maintenance/RepairShareOwnership.php index c4d8da7bf74..e3c8a82c9d6 100644 --- a/core/Command/Maintenance/RepairShareOwnership.php +++ b/core/Command/Maintenance/RepairShareOwnership.php @@ -38,15 +38,10 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; class RepairShareOwnership extends Command { - private IDBConnection $dbConnection; - private IUserManager $userManager; - public function __construct( - IDBConnection $dbConnection, - IUserManager $userManager + private IDBConnection $dbConnection, + private IUserManager $userManager, ) { - $this->dbConnection = $dbConnection; - $this->userManager = $userManager; parent::__construct(); } diff --git a/core/Command/Maintenance/UpdateTheme.php b/core/Command/Maintenance/UpdateTheme.php index e469b218b3f..859aaa12d4f 100644 --- a/core/Command/Maintenance/UpdateTheme.php +++ b/core/Command/Maintenance/UpdateTheme.php @@ -33,15 +33,11 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class UpdateTheme extends UpdateJS { - protected IMimeTypeDetector $mimetypeDetector; - protected ICacheFactory $cacheFactory; - public function __construct( IMimeTypeDetector $mimetypeDetector, - ICacheFactory $cacheFactory + protected ICacheFactory $cacheFactory, ) { parent::__construct($mimetypeDetector); - $this->cacheFactory = $cacheFactory; } protected function configure() { |