diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Application.php | 12 | 
1 files changed, 7 insertions, 5 deletions
| diff --git a/src/Application.php b/src/Application.php index 88843ac..05f5c0f 100644 --- a/src/Application.php +++ b/src/Application.php @@ -29,7 +29,7 @@ abstract class Application      // or return this if some error happened during the execution      // (it's equivalent to returning int(1))      // return Command::FAILURE; -    abstract protected function command(): Command; +    abstract protected function commands(): Array;      public function fromArgv()      { @@ -73,11 +73,13 @@ abstract class Application      public function run()      {          $this->application = new SymfonyApplication(); -        $command = $this->command(); +        $commands = $this->commands(); -        $this->application->add($command); -        $this->application->setDefaultCommand($command->getName()); -        $this->application->run($this->input, $this->output); +        foreach ($commands as $command) { +            $this->application->add($command); +            $this->application->setDefaultCommand($command->getName()); +            $this->application->run($this->input, $this->output); +        }      }      protected function readStdin() | 
