Skip to content

Commit

Permalink
Make sure that CommandScanner scans proper classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpustulka committed Nov 6, 2017
1 parent 22c2027 commit 300e173
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Console/CommandScanner.php
Expand Up @@ -147,11 +147,16 @@ protected function scanDir($path, $namespace, $prefix, array $hide)
continue;
}

$class = $namespace . $shell;
if (!is_subclass_of($class, Shell::class) && !is_subclass_of($class, Command::class)) {
continue;
}

$shells[] = [
'file' => $path . $file,
'fullName' => $prefix . $name,
'name' => $name,
'class' => $namespace . $shell
'class' => $class
];
}

Expand Down

0 comments on commit 300e173

Please sign in to comment.