src/FrontController.php
private function runRoute(array $routeInfo): Response
    {
        /** @noinspection PhpUnusedLocalVariableInspection */
        list($_, $callback, $vars) = $routeInfo;

        $vars = array_filter($vars, function($var) {
            return strpos($var, '_') !== 0;
        }, ARRAY_FILTER_USE_KEY);

        if (!class_exists($callback[0])) {
            throw new ControllerNotFoundException(
                'Trying to instantiate a non existent controller (`' . $callback[0] . '`)'
            );
        }

        $controller = new $callback[0]($this->response, $this->session);

        if (!method_exists($controller, $callback[1])) {
            throw new ActionNotFoundException(
                'Trying to call a non existent action (`' . $callback[0] . '::' . $callback[1] . '`)'
            );
        }

        return $this->injector->execute([$controller, $callback[1]], array_map('urldecode', $vars));
    }
private function runRoute(array $routeInfo): Response
    {
        /** @noinspection PhpUnusedLocalVariableInspection */
        list($_, $callback, $vars) = $routeInfo;

        $vars = array_filter($vars, function($var) {
            return strpos($var, '_') !== 0;
        }, ARRAY_FILTER_USE_KEY);

        if (!class_exists($callback[0])) {
            throw new ControllerNotFoundException(
                'Trying to instantiate a non existent controller (`' . $callback[0] . '`)'
            );
        }

        $controller = new $callback[0]($this->response, $this->session);

        if (!method_exists($controller, $callback[1])) {
            throw new ActionNotFoundException(
                'Trying to call a non existent action (`' . $callback[0] . '::' . $callback[1] . '`)'
            );
        }

        return $this->injector->execute([$controller, $callback[1]], array_map('urldecode', $vars));
    }
private function runRoute ( array $ routeInfo ) : Response { /** @noinspection PhpUnusedLocalVariableInspection */ list ( $ _ , $ callback , $ vars ) = $ routeInfo ; $ vars = array_filter ( $ vars , function ( $ var ) { return strpos ( $ var , '_' ) !== 0 ; } , ARRAY_FILTER_USE_KEY ) ; if ( ! class_exists ( $ callback [ 0 ] ) ) { throw new ControllerNotFoundException ( 'Trying to instantiate a non existent controller (`' . $ callback [ 0 ] . '`)' ) ; } $ controller = new $ callback [ 0 ] ( $ this -> response , $ this -> session ) ; if ( ! method_exists ( $ controller , $ callback [ 1 ] ) ) { throw new ActionNotFoundException ( 'Trying to call a non existent action (`' . $ callback [ 0 ] . '::' . $ callback [ 1 ] . '`)' ) ; } return $ this -> injector -> execute ( [ $ controller , $ callback [ 1 ] ] , array_map ( 'urldecode' , $ vars ) ) ; }
Runs a route

@param array $routeInfo The info of the active route

@return \CodeCollab\Http\Response\Response The HTTP response

@throws \CodeCollab\Router\ControllerNotFoundException When trying to instantiate a non existent controller
@throws \CodeCollab\Router\ActionNotFoundException When trying to call a non existent action
Runs a route