diff options
author | Faraz Samapoor <fsa@adlas.at> | 2023-06-12 18:32:59 +0330 |
---|---|---|
committer | Louis <6653109+artonge@users.noreply.github.com> | 2023-06-19 12:55:27 +0200 |
commit | ea844ca5fbaacb8b4b68d82b6682fa01a1fa09e0 (patch) | |
tree | 1e85b94509892cdbcd92ca76b508b0886806115f /core | |
parent | ceee417d2c48153d25460405c55594f8fdbb6b80 (diff) | |
download | nextcloud-server-ea844ca5fbaacb8b4b68d82b6682fa01a1fa09e0.tar.gz nextcloud-server-ea844ca5fbaacb8b4b68d82b6682fa01a1fa09e0.zip |
Uses PHP8's constructor property promotion.
in core/Command/App, /Background, and /Broadcast classes.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
Diffstat (limited to 'core')
-rw-r--r-- | core/Command/App/Disable.php | 4 | ||||
-rw-r--r-- | core/Command/App/Enable.php | 9 | ||||
-rw-r--r-- | core/Command/App/ListApps.php | 5 | ||||
-rw-r--r-- | core/Command/App/Remove.php | 13 | ||||
-rw-r--r-- | core/Command/App/Update.php | 13 | ||||
-rw-r--r-- | core/Command/Background/Base.php | 4 | ||||
-rw-r--r-- | core/Command/Background/Job.php | 11 | ||||
-rw-r--r-- | core/Command/Background/ListCommand.php | 5 | ||||
-rw-r--r-- | core/Command/Broadcast/Test.php | 5 |
9 files changed, 23 insertions, 46 deletions
diff --git a/core/Command/App/Disable.php b/core/Command/App/Disable.php index 0ed4d29cf41..c31d65d9464 100644 --- a/core/Command/App/Disable.php +++ b/core/Command/App/Disable.php @@ -33,12 +33,10 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class Disable extends Command implements CompletionAwareInterface { - protected IAppManager $appManager; protected int $exitCode = 0; - public function __construct(IAppManager $appManager) { + public function __construct(protected IAppManager $appManager) { parent::__construct(); - $this->appManager = $appManager; } protected function configure(): void { diff --git a/core/Command/App/Enable.php b/core/Command/App/Enable.php index d50c8d79181..c3ab8be38ce 100644 --- a/core/Command/App/Enable.php +++ b/core/Command/App/Enable.php @@ -39,14 +39,13 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class Enable extends Command implements CompletionAwareInterface { - protected IAppManager $appManager; - protected IGroupManager $groupManager; protected int $exitCode = 0; - public function __construct(IAppManager $appManager, IGroupManager $groupManager) { + public function __construct( + protected IAppManager $appManager, + protected IGroupManager $groupManager, + ) { parent::__construct(); - $this->appManager = $appManager; - $this->groupManager = $groupManager; } protected function configure(): void { diff --git a/core/Command/App/ListApps.php b/core/Command/App/ListApps.php index 365ac48e080..cb48c2007b0 100644 --- a/core/Command/App/ListApps.php +++ b/core/Command/App/ListApps.php @@ -33,11 +33,8 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class ListApps extends Base { - protected IAppManager $manager; - - public function __construct(IAppManager $manager) { + public function __construct(protected IAppManager $manager) { parent::__construct(); - $this->manager = $manager; } protected function configure() { diff --git a/core/Command/App/Remove.php b/core/Command/App/Remove.php index ced17e3ef92..522ddc20e07 100644 --- a/core/Command/App/Remove.php +++ b/core/Command/App/Remove.php @@ -39,15 +39,12 @@ use Symfony\Component\Console\Output\OutputInterface; use Throwable; class Remove extends Command implements CompletionAwareInterface { - protected IAppManager $manager; - private Installer $installer; - private LoggerInterface $logger; - - public function __construct(IAppManager $manager, Installer $installer, LoggerInterface $logger) { + public function __construct( + protected IAppManager $manager, + private Installer $installer, + private LoggerInterface $logger, + ) { parent::__construct(); - $this->manager = $manager; - $this->installer = $installer; - $this->logger = $logger; } protected function configure() { diff --git a/core/Command/App/Update.php b/core/Command/App/Update.php index 6a6d43c28e5..ca6a6758dbd 100644 --- a/core/Command/App/Update.php +++ b/core/Command/App/Update.php @@ -37,15 +37,12 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class Update extends Command { - protected IAppManager $manager; - private Installer $installer; - private LoggerInterface $logger; - - public function __construct(IAppManager $manager, Installer $installer, LoggerInterface $logger) { + public function __construct( + protected IAppManager $manager, + private Installer $installer, + private LoggerInterface $logger, + ) { parent::__construct(); - $this->manager = $manager; - $this->installer = $installer; - $this->logger = $logger; } protected function configure() { diff --git a/core/Command/Background/Base.php b/core/Command/Background/Base.php index dca7b58a5fc..130db9e79d8 100644 --- a/core/Command/Background/Base.php +++ b/core/Command/Background/Base.php @@ -38,11 +38,9 @@ use Symfony\Component\Console\Output\OutputInterface; */ abstract class Base extends Command { abstract protected function getMode(); - protected IConfig $config; - public function __construct(IConfig $config) { + public function __construct(protected IConfig $config) { parent::__construct(); - $this->config = $config; } protected function configure() { diff --git a/core/Command/Background/Job.php b/core/Command/Background/Job.php index 823498cf8ca..aeee60bd6a5 100644 --- a/core/Command/Background/Job.php +++ b/core/Command/Background/Job.php @@ -35,14 +35,11 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class Job extends Command { - protected IJobList $jobList; - protected ILogger $logger; - - public function __construct(IJobList $jobList, - ILogger $logger) { + public function __construct( + protected IJobList $jobList, + protected ILogger $logger, + ) { parent::__construct(); - $this->jobList = $jobList; - $this->logger = $logger; } protected function configure(): void { diff --git a/core/Command/Background/ListCommand.php b/core/Command/Background/ListCommand.php index 4116bfa0ff1..6119fb76de9 100644 --- a/core/Command/Background/ListCommand.php +++ b/core/Command/Background/ListCommand.php @@ -32,11 +32,8 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class ListCommand extends Base { - protected IJobList $jobList; - - public function __construct(IJobList $jobList) { + public function __construct(protected IJobList $jobList) { parent::__construct(); - $this->jobList = $jobList; } protected function configure(): void { diff --git a/core/Command/Broadcast/Test.php b/core/Command/Broadcast/Test.php index 7a67c983f79..71d7e2cacdb 100644 --- a/core/Command/Broadcast/Test.php +++ b/core/Command/Broadcast/Test.php @@ -34,11 +34,8 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class Test extends Command { - private IEventDispatcher $eventDispatcher; - - public function __construct(IEventDispatcher $eventDispatcher) { + public function __construct(private IEventDispatcher $eventDispatcher) { parent::__construct(); - $this->eventDispatcher = $eventDispatcher; } protected function configure(): void { |