think\Console::getDefaultCommands PHP Method

getDefaultCommands() protected method

设置默认命令
protected getDefaultCommands ( ) : Command[]
return think\console\Command[] An array of default Command instances
    protected function getDefaultCommands()
    {
        $defaultCommands = [];
        foreach (self::$defaultCommands as $classname) {
            if (class_exists($classname) && is_subclass_of($classname, "think\\console\\Command")) {
                $defaultCommands[] = new $classname();
            }
        }
        return $defaultCommands;
    }