update:优化代码
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user