|
11 | 11 |
|
12 | 12 | namespace Symfony\Bundle\FrameworkBundle\Console; |
13 | 13 |
|
| 14 | +use Symfony\Component\Console\Command\ListCommand; |
14 | 15 | use Symfony\Component\Console\Output\ConsoleOutputInterface; |
15 | 16 | use Symfony\Component\Console\Style\SymfonyStyle; |
16 | 17 | use Symfony\Component\Debug\Exception\FatalThrowableError; |
@@ -79,11 +80,23 @@ public function doRun(InputInterface $input, OutputInterface $output) |
79 | 80 | */ |
80 | 81 | protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output) |
81 | 82 | { |
| 83 | + if (!$command instanceof ListCommand) { |
| 84 | + if ($this->registrationErrors) { |
| 85 | + $this->renderRegistrationErrors($input, $output); |
| 86 | + $this->registrationErrors = array(); |
| 87 | + } |
| 88 | + |
| 89 | + return parent::doRunCommand($command, $input, $output); |
| 90 | + } |
| 91 | + |
| 92 | + $returnCode = parent::doRunCommand($command, $input, $output); |
| 93 | + |
82 | 94 | if ($this->registrationErrors) { |
83 | 95 | $this->renderRegistrationErrors($input, $output); |
| 96 | + $this->registrationErrors = array(); |
84 | 97 | } |
85 | 98 |
|
86 | | - return parent::doRunCommand($command, $input, $output); |
| 99 | + return $returnCode; |
87 | 100 | } |
88 | 101 |
|
89 | 102 | /** |
@@ -192,7 +205,5 @@ private function renderRegistrationErrors(InputInterface $input, OutputInterface |
192 | 205 | foreach ($this->registrationErrors as $error) { |
193 | 206 | $this->doRenderException($error, $output); |
194 | 207 | } |
195 | | - |
196 | | - $this->registrationErrors = array(); |
197 | 208 | } |
198 | 209 | } |
0 commit comments