src/Routes/Controller.php
public function resolveAction(RequestApplicationInterface $app, string $action, ...$params)
    {
        $action = $this->normalizeActionName($action);
        $actionId = static::getActionId($action);
        if (!in_array($app, $params)) {
            array_unshift($params, $app);
        }
        $self = $this;
        return $this->validateAction($action, $app)->then(
            function() use (&$app, &$self, $action, $actionId, $params) {
                if ($this->beforeAction($actionId)) {
                    $app->view->context = $self;
                    return Reaction::$di->invoke([$self, $action], $params);
                } else {
                    throw new Exception("Before action error");
                }
            },
            function($error) {
                if (!$error instanceof \Throwable) {
                    $error = new ForbiddenException('You can not perform this action');
                }
                throw $error;
            }
        )->then(
            function($result = null) use ($actionId) {
                return $this->afterAction($actionId, $result);
            }
        );
    }
public function resolveAction(RequestApplicationInterface $app, string $action, ...$params)
    {
        $action = $this->normalizeActionName($action);
        $actionId = static::getActionId($action);
        if (!in_array($app, $params)) {
            array_unshift($params, $app);
        }
        $self = $this;
        return $this->validateAction($action, $app)->then(
            function() use (&$app, &$self, $action, $actionId, $params) {
                if ($this->beforeAction($actionId)) {
                    $app->view->context = $self;
                    return Reaction::$di->invoke([$self, $action], $params);
                } else {
                    throw new Exception("Before action error");
                }
            },
            function($error) {
                if (!$error instanceof \Throwable) {
                    $error = new ForbiddenException('You can not perform this action');
                }
                throw $error;
            }
        )->then(
            function($result = null) use ($actionId) {
                return $this->afterAction($actionId, $result);
            }
        );
    }
Resolve controller action
@param string                      $action
@param RequestApplicationInterface $app
@param mixed                       ...$params
@return mixed
@throws NotFoundException