]> source.dussan.org Git - nextcloud-server.git/commitdiff
Uses PHP8's constructor property promotion.
authorFaraz Samapoor <fsa@adlas.at>
Mon, 12 Jun 2023 15:46:09 +0000 (19:16 +0330)
committerLouis <6653109+artonge@users.noreply.github.com>
Mon, 19 Jun 2023 15:44:48 +0000 (17:44 +0200)
 in core/Command/Log, /Security, and /SystemTag classes.

Signed-off-by: Faraz Samapoor <fsa@adlas.at>
core/Command/Log/File.php
core/Command/Log/Manage.php
core/Command/Security/ImportCertificate.php
core/Command/Security/ListCertificates.php
core/Command/Security/RemoveCertificate.php
core/Command/Security/ResetBruteforceAttempts.php
core/Command/SystemTag/Add.php
core/Command/SystemTag/Delete.php
core/Command/SystemTag/Edit.php
core/Command/SystemTag/ListCommand.php

index 6d6e530fe9aed2d822a099e0b13cba2259aaf3e6..4e3dc97a54649244e1b9a71044c6d7187fe8971c 100644 (file)
@@ -36,10 +36,7 @@ use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class File extends Command implements Completion\CompletionAwareInterface {
-       protected IConfig $config;
-
-       public function __construct(IConfig $config) {
-               $this->config = $config;
+       public function __construct(protected IConfig $config) {
                parent::__construct();
        }
 
index 63a8efde370b54761856d23382ff5edb4c70245e..500bc1e8a524d29c01d5da2fed3450d63ebe670b 100644 (file)
@@ -39,10 +39,7 @@ class Manage extends Command implements CompletionAwareInterface {
        public const DEFAULT_LOG_LEVEL = 2;
        public const DEFAULT_TIMEZONE = 'UTC';
 
-       protected IConfig $config;
-
-       public function __construct(IConfig $config) {
-               $this->config = $config;
+       public function __construct(protected IConfig $config) {
                parent::__construct();
        }
 
index 9db7889e30706aae8d279eb6140babde1444390d..f3a44face48d25287f30f2c471ba2796a8a4f1a5 100644 (file)
@@ -30,10 +30,7 @@ use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class ImportCertificate extends Base {
-       protected ICertificateManager $certificateManager;
-
-       public function __construct(ICertificateManager $certificateManager) {
-               $this->certificateManager = $certificateManager;
+       public function __construct(protected ICertificateManager $certificateManager) {
                parent::__construct();
        }
 
index 15dd1812077d1cebcd0efe7493249053916bce2b..96063fb5b61930f7d536a5bc68017ac9ed8f21dc 100644 (file)
@@ -31,12 +31,10 @@ use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class ListCertificates extends Base {
-       protected ICertificateManager $certificateManager;
-       protected IL10N $l;
-
-       public function __construct(ICertificateManager $certificateManager, IL10N $l) {
-               $this->certificateManager = $certificateManager;
-               $this->l = $l;
+       public function __construct(
+               protected ICertificateManager $certificateManager,
+               protected IL10N $l,
+       ) {
                parent::__construct();
        }
 
index 2f9c6ff978ac1fccfe8d074d1f4c3975d950ad5d..51ddfc981118128def13da16c4bf441bac6a7c72 100644 (file)
@@ -30,10 +30,7 @@ use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class RemoveCertificate extends Base {
-       protected ICertificateManager $certificateManager;
-
-       public function __construct(ICertificateManager $certificateManager) {
-               $this->certificateManager = $certificateManager;
+       public function __construct(protected ICertificateManager $certificateManager) {
                parent::__construct();
        }
 
index 8def0873bdfcadb36adcc9709dd3d42aa7b57817..a203d1daa1073615efcb4b670bb09804659dd353 100644 (file)
@@ -30,10 +30,7 @@ use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class ResetBruteforceAttempts extends Base {
-       protected Throttler $throttler;
-
-       public function __construct(Throttler $throttler) {
-               $this->throttler = $throttler;
+       public function __construct(protected Throttler $throttler) {
                parent::__construct();
        }
 
index f4fb80eb70a50f69e6f98cd1bb84e2f738734326..7df8d5e03ebbe0b85e0e22f3d2af2c9a9db9d13d 100644 (file)
@@ -31,10 +31,7 @@ use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class Add extends Base {
-       protected ISystemTagManager $systemTagManager;
-
-       public function __construct(ISystemTagManager $systemTagManager) {
-               $this->systemTagManager = $systemTagManager;
+       public function __construct(protected ISystemTagManager $systemTagManager) {
                parent::__construct();
        }
 
index 4c1145ae1b467a560bdd7b29a2244faa550075dc..a23b09d4e56efefdce53fe35ee009ab590126da7 100644 (file)
@@ -30,10 +30,7 @@ use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class Delete extends Base {
-       protected ISystemTagManager $systemTagManager;
-
-       public function __construct(ISystemTagManager $systemTagManager) {
-               $this->systemTagManager = $systemTagManager;
+       public function __construct(protected ISystemTagManager $systemTagManager) {
                parent::__construct();
        }
 
index 7ed933c3b358173fdb972ddaf072f6d7b946e1f9..d3c68a2b76e60c115c4415bfb4f613bafd29af6c 100644 (file)
@@ -31,10 +31,7 @@ use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class Edit extends Base {
-       protected ISystemTagManager $systemTagManager;
-
-       public function __construct(ISystemTagManager $systemTagManager) {
-               $this->systemTagManager = $systemTagManager;
+       public function __construct(protected ISystemTagManager $systemTagManager) {
                parent::__construct();
        }
 
index 7993eb878911bd8c7c86d9ee827e7fdd70621875..c968fb14ef2e0fee16927204102e37c0274bbebb 100644 (file)
@@ -30,10 +30,7 @@ use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Output\OutputInterface;
 
 class ListCommand extends Base {
-       protected ISystemTagManager $systemTagManager;
-
-       public function __construct(ISystemTagManager $systemTagManager) {
-               $this->systemTagManager = $systemTagManager;
+       public function __construct(protected ISystemTagManager $systemTagManager) {
                parent::__construct();
        }