Browse Source

Uses PHP8's constructor property promotion in core/Command/Config and core/Command/Group classes.

Signed-off-by: Faraz Samapoor <fsa@adlas.at>
tags/v28.0.0beta1
Faraz Samapoor 1 year ago
parent
commit
3519689d50

+ 1
- 7
core/Command/Config/App/DeleteConfig.php View File

@@ -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() {

+ 1
- 4
core/Command/Config/App/GetConfig.php View File

@@ -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() {

+ 1
- 4
core/Command/Config/App/SetConfig.php View File

@@ -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() {

+ 1
- 3
core/Command/Config/Import.php View File

@@ -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() {

+ 4
- 5
core/Command/Config/ListConfigs.php View File

@@ -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() {

+ 1
- 4
core/Command/Config/System/Base.php View File

@@ -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;
}

/**

+ 1
- 4
core/Command/Group/Add.php View File

@@ -36,10 +36,7 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class Add extends Base {
protected IGroupManager $groupManager;

public function __construct(IGroupManager $groupManager) {
$this->groupManager = $groupManager;
public function __construct(protected IGroupManager $groupManager) {
parent::__construct();
}


+ 4
- 6
core/Command/Group/AddUser.php View File

@@ -34,12 +34,10 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class AddUser extends Base {
protected IUserManager $userManager;
protected IGroupManager $groupManager;

public function __construct(IUserManager $userManager, IGroupManager $groupManager) {
$this->userManager = $userManager;
$this->groupManager = $groupManager;
public function __construct(
protected IUserManager $userManager,
protected IGroupManager $groupManager,
) {
parent::__construct();
}


+ 1
- 4
core/Command/Group/Delete.php View File

@@ -35,10 +35,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class Delete extends Base {
protected IGroupManager $groupManager;

public function __construct(IGroupManager $groupManager) {
$this->groupManager = $groupManager;
public function __construct(protected IGroupManager $groupManager) {
parent::__construct();
}


+ 1
- 4
core/Command/Group/Info.php View File

@@ -35,10 +35,7 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class Info extends Base {
protected IGroupManager $groupManager;

public function __construct(IGroupManager $groupManager) {
$this->groupManager = $groupManager;
public function __construct(protected IGroupManager $groupManager) {
parent::__construct();
}


+ 1
- 4
core/Command/Group/ListCommand.php View File

@@ -32,10 +32,7 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class ListCommand extends Base {
protected IGroupManager $groupManager;

public function __construct(IGroupManager $groupManager) {
$this->groupManager = $groupManager;
public function __construct(protected IGroupManager $groupManager) {
parent::__construct();
}


+ 4
- 6
core/Command/Group/RemoveUser.php View File

@@ -34,12 +34,10 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class RemoveUser extends Base {
protected IUserManager $userManager;
protected IGroupManager $groupManager;

public function __construct(IUserManager $userManager, IGroupManager $groupManager) {
$this->userManager = $userManager;
$this->groupManager = $groupManager;
public function __construct(
protected IUserManager $userManager,
protected IGroupManager $groupManager,
) {
parent::__construct();
}


Loading…
Cancel
Save