From ea844ca5fbaacb8b4b68d82b6682fa01a1fa09e0 Mon Sep 17 00:00:00 2001 From: Faraz Samapoor Date: Mon, 12 Jun 2023 18:32:59 +0330 Subject: Uses PHP8's constructor property promotion. in core/Command/App, /Background, and /Broadcast classes. Signed-off-by: Faraz Samapoor --- core/Command/App/Disable.php | 4 +--- core/Command/App/Enable.php | 9 ++++----- core/Command/App/ListApps.php | 5 +---- core/Command/App/Remove.php | 13 +++++-------- core/Command/App/Update.php | 13 +++++-------- 5 files changed, 16 insertions(+), 28 deletions(-) (limited to 'core/Command/App') 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() { -- cgit v1.2.3