update:优化代码

This commit is contained in:
JaguarJack
2020-07-28 08:19:51 +08:00
parent cba66dfe58
commit fae47bf246

View File

@@ -46,11 +46,9 @@ class CatchConsole
$lastPath = str_replace($this->parseNamespace(), '',pathinfo($command, PATHINFO_DIRNAME)); $lastPath = str_replace($this->parseNamespace(), '',pathinfo($command, PATHINFO_DIRNAME));
$namespace = $this->namespace . str_replace(DIRECTORY_SEPARATOR, '\\', $lastPath) . '\\'; $namespace = $this->namespace . str_replace(DIRECTORY_SEPARATOR, '\\', $lastPath) . '\\';
$commandClass = $namespace . pathinfo($command, PATHINFO_FILENAME); $commandClass = $namespace . pathinfo($command, PATHINFO_FILENAME);
if (is_subclass_of($commandClass, Command::class)) {
$commands[] = $commandClass; $commands[] = $commandClass;
} }
} }
}
return $commands; return $commands;
} }