Skip to content

Commit 0e98196

Browse files
committed
src: fix Error: Call to undefined method Photobooth\Console\Application::add()
Change-Id: I92de7695d89869f483f6e13a7510b95b97db1779
1 parent 9c8a7dd commit 0e98196

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

src/Console/Application.php

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,29 @@
88
use Photobooth\Service\ApplicationService;
99
use Symfony\Component\Console\Application as BaseApplication;
1010

11-
/**
12-
* @method void add(\Symfony\Component\Console\Command\Command $command)
13-
*/
1411
class Application extends BaseApplication
1512
{
1613
protected array $photoboothConfig = [];
1714

1815
public function __construct(array $photoboothConfig)
1916
{
2017
$this->photoboothConfig = $photoboothConfig;
21-
parent::__construct('Photobooth', ApplicationService::getInstance()->getVersion());
22-
$this->add((new Command\ConfigListCommand())->setPhotoboothConfig($this->photoboothConfig));
23-
$this->add((new Command\EnvironmentListCommand()));
18+
19+
parent::__construct(
20+
'Photobooth',
21+
ApplicationService::getInstance()->getVersion()
22+
);
23+
}
24+
25+
protected function getDefaultCommands(): array
26+
{
27+
return array_merge(
28+
parent::getDefaultCommands(),
29+
[
30+
(new Command\ConfigListCommand())
31+
->setPhotoboothConfig($this->photoboothConfig),
32+
new Command\EnvironmentListCommand(),
33+
]
34+
);
2435
}
2536
}

0 commit comments

Comments
 (0)