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.5] Updated Console/Kernel autoloading of commands to ignore abstract classes #20931

Merged
merged 1 commit into from
Sep 2, 2017

Conversation

davidrushton
Copy link
Contributor

The new Laravel 5.5 auto loading of console commands is great.

Unfortunately it didn't work in my app, as I use an abstract class that extends Illuminate\Console\Command, so the is_subclass_of($command, Command::class) was resolving that abstract class causing a Illuminate\Contracts\Container\BindingResolutionException exception.

This PR changes the conditional to use ReflectionClass and the isAbstract and isSubclassOf methods, fixing this issue.

PS. My abstract console class is extended by custom migration classes that are necessary for our multi-tenant / multi-database migrations, while the base migrator commands act on our primary database.

@davidrushton davidrushton changed the title Updated Console/Kernel autoloading of commands to ignore abstract classes [5.5] Updated Console/Kernel autoloading of commands to ignore abstract classes Sep 2, 2017
@taylorotwell taylorotwell merged commit fd9319f into laravel:5.5 Sep 2, 2017
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