Skip to content
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

[5.6] Check whether method fetch exists instead of checking variable existence #23471

Merged
merged 1 commit into from
Mar 9, 2018

Conversation

mohamed-aiman
Copy link
Contributor

check whether method fetch exists instead of checking variable existence before calling fetch method as $this->lastOutput might be an object of ConsoleOutput which implements OutputInterface but doesn't have fetch method.

Now that its possible to pass OutputInterface which doesn't strict output method and also some will be passing instances of Symfony\Component\Console\Output\ConsoleOutput, in this case, it will through the following error.
Call to undefined method Symfony\Component\Console\Output\ConsoleOutput::fetch()
To prevent it from throwing error we are checking

check whether method fetch exists instead of checking variable existence before calling fetch method as $this->lastOutput might be an object of ConsoleOutput which implements OutputInterface but doesn't have fetch method.

Now that its possible to pass OutputInterface which doesn't strict output method and also some will be passing instances of Symfony\Component\Console\Output\ConsoleOutput, in this case, it will through the following error. 
Call to undefined method Symfony\Component\Console\Output\ConsoleOutput::fetch()
To prevent it from throwing error we are checking
@taylorotwell taylorotwell merged commit d9a693c into laravel:5.6 Mar 9, 2018
@GrahamCampbell GrahamCampbell changed the title check whether method fetch exists instead of checking variable existence [5.6] Check whether method fetch exists instead of checking variable existence Mar 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants