-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Fix bug with $output overloading #16621
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,9 +72,9 @@ protected function configure() | |
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output) | ||
protected function execute(InputInterface $input, OutputInterface $cliOutput) | ||
{ | ||
$output = new SymfonyStyle($input, $output); | ||
$output = new SymfonyStyle($input, $cliOutput); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know would such thing be allowed: |
||
|
||
if (!extension_loaded('pcntl')) { | ||
$output->error(array( | ||
|
@@ -85,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output) | |
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; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not named according to the parent definition. Also
inheritdoc
will not work this way.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, and it makes more sense to me to do the opposite: use
OutputInterface $output
here, then rename the other variable, like$styleOutput = new SymfonyStyle(...)
. That's mostly because we tend to always call the argument$output
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weaverryan do you have some ideas for #16000? Thanks!