aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command/App
diff options
context:
space:
mode:
authorFaraz Samapoor <fsa@adlas.at>2023-06-12 18:32:59 +0330
committerLouis <6653109+artonge@users.noreply.github.com>2023-06-19 12:55:27 +0200
commitea844ca5fbaacb8b4b68d82b6682fa01a1fa09e0 (patch)
tree1e85b94509892cdbcd92ca76b508b0886806115f /core/Command/App
parentceee417d2c48153d25460405c55594f8fdbb6b80 (diff)
downloadnextcloud-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/Command/App')
-rw-r--r--core/Command/App/Disable.php4
-rw-r--r--core/Command/App/Enable.php9
-rw-r--r--core/Command/App/ListApps.php5
-rw-r--r--core/Command/App/Remove.php13
-rw-r--r--core/Command/App/Update.php13
5 files changed, 16 insertions, 28 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() {