mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
Uses PHP8's constructor property promotion.
in core/Command/App, /Background, and /Broadcast classes. Signed-off-by: Faraz Samapoor <fsa@adlas.at>
This commit is contained in:
parent
ceee417d2c
commit
ea844ca5fb
9 changed files with 23 additions and 46 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue