From 01f4884f14705bac1d70bb514662b32484f2330e Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Tue, 25 Jan 2022 18:27:34 +0000 Subject: [PATCH] Make stronger assertion before caching commands --- src/Illuminate/Console/Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Console/Application.php b/src/Illuminate/Console/Application.php index 3c1b87f9f30c..3c7f5c9bf9b2 100755 --- a/src/Illuminate/Console/Application.php +++ b/src/Illuminate/Console/Application.php @@ -267,7 +267,7 @@ protected function addToParent(SymfonyCommand $command) */ public function resolve($command) { - if (class_exists($command) && ($commandName = $command::getDefaultName())) { + if (is_subclass_of($command, SymfonyCommand::class) && ($commandName = $command::getDefaultName())) { $this->commandMap[$commandName] = $command; return null;