Skip to content

Commit

Permalink
Updated Console/Kernel autoload command to ignore Abstract classes (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrushton authored and taylorotwell committed Sep 2, 2017
1 parent 84291a6 commit fd9319f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Illuminate/Foundation/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit fd9319f

Please sign in to comment.