aboutsummaryrefslogtreecommitdiffstats
path: root/core/Command/Config
diff options
context:
space:
mode:
authorFaraz Samapoor <fsa@adlas.at>2023-06-12 18:22:05 +0330
committerLouis <6653109+artonge@users.noreply.github.com>2023-06-20 09:29:50 +0200
commit3519689d50434978a5ad083871686a9f59f9273e (patch)
tree2f75d8faadc07a5d12607b3ed0dee07511c168d6 /core/Command/Config
parent64c19ce3aab20cae15bd522428ae54548a76b78b (diff)
downloadnextcloud-server-3519689d50434978a5ad083871686a9f59f9273e.tar.gz
nextcloud-server-3519689d50434978a5ad083871686a9f59f9273e.zip
Uses PHP8's constructor property promotion in core/Command/Config and core/Command/Group classes.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
Diffstat (limited to 'core/Command/Config')
-rw-r--r--core/Command/Config/App/DeleteConfig.php8
-rw-r--r--core/Command/Config/App/GetConfig.php5
-rw-r--r--core/Command/Config/App/SetConfig.php5
-rw-r--r--core/Command/Config/Import.php4
-rw-r--r--core/Command/Config/ListConfigs.php9
-rw-r--r--core/Command/Config/System/Base.php5
6 files changed, 9 insertions, 27 deletions
diff --git a/core/Command/Config/App/DeleteConfig.php b/core/Command/Config/App/DeleteConfig.php
index 0da1e965bd0..577378559b3 100644
--- a/core/Command/Config/App/DeleteConfig.php
+++ b/core/Command/Config/App/DeleteConfig.php
@@ -28,14 +28,8 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class DeleteConfig extends Base {
- protected IConfig $config;
-
- /**
- * @param 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/Config/App/GetConfig.php b/core/Command/Config/App/GetConfig.php
index 7fdff2be732..3ed327fac79 100644
--- a/core/Command/Config/App/GetConfig.php
+++ b/core/Command/Config/App/GetConfig.php
@@ -28,11 +28,8 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class GetConfig extends Base {
- 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/Config/App/SetConfig.php b/core/Command/Config/App/SetConfig.php
index 89a5f6ba5d1..dcc3fd58bf7 100644
--- a/core/Command/Config/App/SetConfig.php
+++ b/core/Command/Config/App/SetConfig.php
@@ -28,11 +28,8 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class SetConfig extends Base {
- 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/Config/Import.php b/core/Command/Config/Import.php
index 227c909038c..90c92bff489 100644
--- a/core/Command/Config/Import.php
+++ b/core/Command/Config/Import.php
@@ -35,11 +35,9 @@ use Symfony\Component\Console\Output\OutputInterface;
class Import extends Command implements CompletionAwareInterface {
protected array $validRootKeys = ['system', 'apps'];
- 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/Config/ListConfigs.php b/core/Command/Config/ListConfigs.php
index dd8fad72d7c..4adb0a9df5b 100644
--- a/core/Command/Config/ListConfigs.php
+++ b/core/Command/Config/ListConfigs.php
@@ -33,13 +33,12 @@ use Symfony\Component\Console\Output\OutputInterface;
class ListConfigs extends Base {
protected string $defaultOutputFormat = self::OUTPUT_FORMAT_JSON_PRETTY;
- protected SystemConfig $systemConfig;
- protected IAppConfig $appConfig;
- public function __construct(SystemConfig $systemConfig, IAppConfig $appConfig) {
+ public function __construct(
+ protected SystemConfig $systemConfig,
+ protected IAppConfig $appConfig,
+ ) {
parent::__construct();
- $this->systemConfig = $systemConfig;
- $this->appConfig = $appConfig;
}
protected function configure() {
diff --git a/core/Command/Config/System/Base.php b/core/Command/Config/System/Base.php
index 18bc9cb7ca0..0824af8d18c 100644
--- a/core/Command/Config/System/Base.php
+++ b/core/Command/Config/System/Base.php
@@ -26,11 +26,8 @@ use OC\SystemConfig;
use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext;
abstract class Base extends \OC\Core\Command\Base {
- protected SystemConfig $systemConfig;
-
- public function __construct(SystemConfig $systemConfig) {
+ public function __construct(protected SystemConfig $systemConfig) {
parent::__construct();
- $this->systemConfig = $systemConfig;
}
/**