lithium\console\Dispatcher::_callable PHP Метод

_callable() защищенный статический Метод

Determines which command to use for current request.
protected static _callable ( object $request, array $params, array $options ) : class
$request object An instance of a `Request` object.
$params array Request params that can be accessed inside the filter.
$options array
Результат class lithium\console\Command Returns the instantiated command object.
    protected static function _callable($request, $params, $options)
    {
        $params = compact('request', 'params', 'options');
        return static::_filter(__FUNCTION__, $params, function ($self, $params) {
            $request = $params['request'];
            $params = $params['params'];
            $name = $params['command'];
            if (!$name) {
                $request->params['args'][0] = $name;
                $name = 'lithium\\console\\command\\Help';
            }
            if (class_exists($class = Libraries::locate('command', $name))) {
                return new $class(compact('request'));
            }
            throw new UnexpectedValueException("Command `{$name}` not found.");
        });
    }