in core/Command/App, /Background, and /Broadcast classes.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
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 {
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 {
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() {
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() {
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() {
*/
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() {
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 {
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 {
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 {