]> source.dussan.org Git - nextcloud-server.git/commitdiff
Uses PHP8's constructor property promotion in core/Command/Maintenance classes.
authorFaraz Samapoor <fsa@adlas.at>
Mon, 12 Jun 2023 14:46:44 +0000 (18:16 +0330)
committerLouis <6653109+artonge@users.noreply.github.com>
Mon, 19 Jun 2023 10:55:22 +0000 (12:55 +0200)
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
core/Command/Maintenance/DataFingerprint.php
core/Command/Maintenance/Install.php
core/Command/Maintenance/Mimetype/UpdateDB.php
core/Command/Maintenance/Mimetype/UpdateJS.php
core/Command/Maintenance/Mode.php
core/Command/Maintenance/Repair.php
core/Command/Maintenance/RepairShareOwnership.php
core/Command/Maintenance/UpdateTheme.php

index a57dc307b18030f53e620f50717508afd9c240c9..3c15b95bc05a94f4d09ecbd5bfb7ece82ebde27d 100644 (file)
@@ -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();
        }
 
index efb99e51431f86da55a830c214fce4dcf92c7a2a..643bb54c0d6051fe4e5ef85ed9143dec9514e8c4 100644 (file)
@@ -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() {
index edc42c0fdcd92503ac9ccce7ad0272d2fccc51a4..212b1994263c080365428968f30d57e0026ad79f 100644 (file)
@@ -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() {
index 6a5a3d0ac61b64ec4b68bc333148028aba9d00bf..fb0244e59baee358f878bc5aca99ff573cbaca56 100644 (file)
@@ -31,13 +31,8 @@ use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class UpdateJS extends Command {
-       protected IMimeTypeDetector $mimetypeDetector;
-
-       public function __construct(
-               IMimeTypeDetector $mimetypeDetector
-       ) {
+       public function __construct(protected IMimeTypeDetector $mimetypeDetector) {
                parent::__construct();
-               $this->mimetypeDetector = $mimetypeDetector;
        }
 
        protected function configure() {
index c2af33aa4edbfb2e8c6a0b47eb0c70df2e89a647..88ca2359155c4f9d3400f16ab1a16218cab19ef2 100644 (file)
@@ -33,10 +33,7 @@ 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();
        }
 
index a1d97476f9412b1783e1b97b65fa994d119c5802..6c40ca2820f52f9803cbe76e9c60d9e124fdbb14 100644 (file)
@@ -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();
        }
 
index c4d8da7bf74f679bd37f8306d4cf5528e3576e5f..e3c8a82c9d6a13b2668eaf18b62649e301175848 100644 (file)
@@ -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();
        }
 
index e469b218b3f2e83f14753d45f245eb13377a9308..859aaa12d4fa6e5b5b7f44ee46ce0e4409cfc149 100644 (file)
@@ -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() {