From fd9319f6a65f06cd5fc81732fa430373def758ca Mon Sep 17 00:00:00 2001 From: David Rushton Date: Sat, 2 Sep 2017 14:04:44 +0100 Subject: [PATCH] Updated Console/Kernel autoload command to ignore Abstract classes (#20931) --- src/Illuminate/Foundation/Console/Kernel.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Console/Kernel.php b/src/Illuminate/Foundation/Console/Kernel.php index 609d8d7bef7a..4121954abe55 100644 --- a/src/Illuminate/Foundation/Console/Kernel.php +++ b/src/Illuminate/Foundation/Console/Kernel.php @@ -5,6 +5,7 @@ use Closure; use Exception; use Throwable; +use ReflectionClass; use Illuminate\Support\Str; use Illuminate\Console\Command; use Symfony\Component\Finder\Finder; @@ -209,7 +210,9 @@ protected function load($paths) Str::after($command->getPathname(), app_path().DIRECTORY_SEPARATOR) ); - if (is_subclass_of($command, Command::class)) { + $reflector = new ReflectionClass($command); + + if (! $reflector->isAbstract() && $reflector->isSubclassOf(Command::class)) { Artisan::starting(function ($artisan) use ($command) { $artisan->resolve($command); });