bug #16621 [Console] Fix bug with $output overloading (WouterJ)

This PR was squashed before being merged into the 2.8 branch (closes #16621).

Discussion
----------

[Console] Fix bug with $output overloading

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony-standard/issues/887, #16622
| License       | MIT
| Doc PR        | -

This is exactly why variable overloading isn't a great idea :)

Commits
-------

5764a00 [Console] Fix bug with  overloading
This commit is contained in:
Fabien Potencier 2015-11-26 17:44:52 +01:00
commit 14f70aeafd
1 changed files with 2 additions and 2 deletions

View File

@ -74,7 +74,7 @@ EOF
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$output = new SymfonyStyle($input, $output);
$output = new SymfonyStyle($input, $cliOutput = $output);
if (!extension_loaded('pcntl')) {
$output->error(array(
@ -85,7 +85,7 @@ EOF
if ($output->ask('Do you want to execute <info>server:run</info> immediately? [Yn] ', true)) {
$command = $this->getApplication()->find('server:run');
return $command->run($input, $output);
return $command->run($input, $cliOutput);
}
return 1;