lithium\console\Command::__invoke PHP Метод

__invoke() публичный Метод

Called by the Dispatcher class to invoke an action.
См. также: lithium\console\Dispatcher
См. также: lithium\console\Response
public __invoke ( string $action, array $args = [] ) : object
$action string The name of the method to run.
$args array The arguments from the request.
Результат object The response object associated with this command.
    public function __invoke($action, $args = array())
    {
        try {
            $this->response->status = 1;
            $result = $this->invokeMethod($action, $args);
            if (is_int($result)) {
                $this->response->status = $result;
            } elseif ($result || $result === null) {
                $this->response->status = 0;
            }
        } catch (Exception $e) {
            $this->error($e->getMessage());
        }
        return $this->response;
    }