src/Yggdrasil/Core/Kernel.php
private function executePassiveActions(Request $request, Response $response): Response
    {
        foreach ($this->getRouter()->getConfiguration()->getPassiveActions() as $action => $whitelist) {
            $activeAction = $this->getRouter()->getActionAlias($request);

            if (!in_array($activeAction, $whitelist) && !in_array('all', $whitelist)) {
                continue;
            }

            if (in_array('-' . $activeAction, $whitelist) && in_array('all', $whitelist)) {
                continue;
            }

            $route = $this->getRouter()->getAliasedRoute($action, [], Router::PASSIVE_ACTION);

            if (!method_exists($route->getController(), $route->getAction())) {
                throw new ActionNotFoundException($action . ' passive action is present in registry, but can\'t be found or is improperly configured.');
            }

            $controllerName = $route->getController();
            $controller = new $controllerName($this->drivers, $request, $response);
            $response = $controller->{$route->getAction()}(...$route->getActionParams());
        }

        return $response;
    }
private function executePassiveActions(Request $request, Response $response): Response
    {
        foreach ($this->getRouter()->getConfiguration()->getPassiveActions() as $action => $whitelist) {
            $activeAction = $this->getRouter()->getActionAlias($request);

            if (!in_array($activeAction, $whitelist) && !in_array('all', $whitelist)) {
                continue;
            }

            if (in_array('-' . $activeAction, $whitelist) && in_array('all', $whitelist)) {
                continue;
            }

            $route = $this->getRouter()->getAliasedRoute($action, [], Router::PASSIVE_ACTION);

            if (!method_exists($route->getController(), $route->getAction())) {
                throw new ActionNotFoundException($action . ' passive action is present in registry, but can\'t be found or is improperly configured.');
            }

            $controllerName = $route->getController();
            $controller = new $controllerName($this->drivers, $request, $response);
            $response = $controller->{$route->getAction()}(...$route->getActionParams());
        }

        return $response;
    }
private function executePassiveActions ( Request $ request , Response $ response ) : Response { foreach ( $ this -> getRouter ( ) -> getConfiguration ( ) -> getPassiveActions ( ) as $ action => $ whitelist ) { $ activeAction = $ this -> getRouter ( ) -> getActionAlias ( $ request ) ; if ( ! in_array ( $ activeAction , $ whitelist ) && ! in_array ( 'all' , $ whitelist ) ) { continue ; } if ( in_array ( '-' . $ activeAction , $ whitelist ) && in_array ( 'all' , $ whitelist ) ) { continue ; } $ route = $ this -> getRouter ( ) -> getAliasedRoute ( $ action , [ ] , Router :: PASSIVE_ACTION ) ; if ( ! method_exists ( $ route -> getController ( ) , $ route -> getAction ( ) ) ) { throw new ActionNotFoundException ( $ action . ' passive action is present in registry, but can\'t be found or is improperly configured.' ) ; } $ controllerName = $ route -> getController ( ) ; $ controller = new $ controllerName ( $ this -> drivers , $ request , $ response ) ; $ response = $ controller -> { $ route -> getAction ( ) } ( ... $ route -> getActionParams ( ) ) ; } return $ response ; }
Executes passive actions existing in registry

@param Request  $request
@param Response $response
@return Response
@throws ActionNotFoundException if passive action can't be found
@throws \Exception
Executes passive actions existing in registry