Skip to content

Commit

Permalink
Merge pull request #1350 from natanfelles/check_command
Browse files Browse the repository at this point in the history
Checks if class is instantiable and is a command
  • Loading branch information
jim-parry authored Oct 25, 2018
2 parents 9a12631 + 8b70142 commit e336dfc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions system/CLI/CommandRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ protected function createCommandList()
continue;
}

$class = new \ReflectionClass($className);

if ( ! $class->isInstantiable() || ! $class->isSubclassOf(BaseCommand::class))
{
continue;
}

$class = new $className($this->logger, $this);

// Store it!
Expand Down

0 comments on commit e336dfc

Please sign in to comment.