public function getCommands($withInternal = false)
    {$commands = [];
        $namespaces = Reaction::$app->router->controllerNamespaces;
        $controllers = Reaction\Helpers\ClassFinderHelper::findClassesPsr4($namespaces, true);
        foreach ($controllers as $controllerClass) {
            if (!$withInternal && Reaction\Helpers\ReflectionHelper::isImplements($controllerClass, 'Reaction\Routes\ControllerInternalInterface')) {
                continue;
            }
            if ($this->validateControllerClass($controllerClass)) {
                $relativePath = Reaction::$app->router->getRelativeControllerNamespace($controllerClass);
                $pathArray = explode('\\', $relativePath);
                $classBasename = array_pop($pathArray);
                $command = Inflector::camel2id(substr($classBasename, 0, -10), '-', true);
                if (!empty($pathArray)) {
                    $classPath = ltrim(implode('/', $pathArray), DIRECTORY_SEPARATOR);
                    $command = $classPath . DIRECTORY_SEPARATOR . $command;
                }
                $commands[] = $command;
            }
        }
        sort($commands);
        return array_unique($commands);
    }
public function getCommands($withInternal = false)
    {$commands = [];
        $namespaces = Reaction::$app->router->controllerNamespaces;
        $controllers = Reaction\Helpers\ClassFinderHelper::findClassesPsr4($namespaces, true);
        foreach ($controllers as $controllerClass) {
            if (!$withInternal && Reaction\Helpers\ReflectionHelper::isImplements($controllerClass, 'Reaction\Routes\ControllerInternalInterface')) {
                continue;
            }
            if ($this->validateControllerClass($controllerClass)) {
                $relativePath = Reaction::$app->router->getRelativeControllerNamespace($controllerClass);
                $pathArray = explode('\\', $relativePath);
                $classBasename = array_pop($pathArray);
                $command = Inflector::camel2id(substr($classBasename, 0, -10), '-', true);
                if (!empty($pathArray)) {
                    $classPath = ltrim(implode('/', $pathArray), DIRECTORY_SEPARATOR);
                    $command = $classPath . DIRECTORY_SEPARATOR . $command;
                }
                $commands[] = $command;
            }
        }
        sort($commands);
        return array_unique($commands);
    }
public function getCommands ( $ withInternal = false ) { $ commands = [ ] ; $ namespaces = Reaction :: $ app -> router -> controllerNamespaces ; $ controllers = Reaction \ Helpers \ ClassFinderHelper :: findClassesPsr4 ( $ namespaces , true ) ; foreach ( $ controllers as $ controllerClass ) { if ( ! $ withInternal && Reaction \ Helpers \ ReflectionHelper :: isImplements ( $ controllerClass , 'Reaction\Routes\ControllerInternalInterface' ) ) { continue ; } if ( $ this -> validateControllerClass ( $ controllerClass ) ) { $ relativePath = Reaction :: $ app -> router -> getRelativeControllerNamespace ( $ controllerClass ) ; $ pathArray = explode ( '\\' , $ relativePath ) ; $ classBasename = array_pop ( $ pathArray ) ; $ command = Inflector :: camel2id ( substr ( $ classBasename , 0 , - 10 ) , '-' , true ) ; if ( ! empty ( $ pathArray ) ) { $ classPath = ltrim ( implode ( '/' , $ pathArray ) , DIRECTORY_SEPARATOR ) ; $ command = $ classPath . DIRECTORY_SEPARATOR . $ command ; } $ commands [ ] = $ command ; } } sort ( $ commands ) ; return array_unique ( $ commands ) ; }
Returns all available command names.
@param bool $withInternal Whenever to show internal controllers
@return array all available command names
Returns all available command names .