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

Projects
None yet
2 participants
@mohamed-aiman
Contributor

mohamed-aiman commented Mar 9, 2018

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
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

2 checks passed

continuous-integration/styleci/pr The StyleCI analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@GrahamCampbell GrahamCampbell changed the title from check whether method fetch exists instead of checking variable existence to [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