Skip to content

Commit e336dfc

Browse files
authored
Merge pull request #1350 from natanfelles/check_command
Checks if class is instantiable and is a command
2 parents 9a12631 + 8b70142 commit e336dfc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

system/CLI/CommandRunner.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ protected function createCommandList()
149149
continue;
150150
}
151151

152+
$class = new \ReflectionClass($className);
153+
154+
if ( ! $class->isInstantiable() || ! $class->isSubclassOf(BaseCommand::class))
155+
{
156+
continue;
157+
}
158+
152159
$class = new $className($this->logger, $this);
153160

154161
// Store it!

0 commit comments

Comments
 (0)