private static function canRoute() {
        $httpContext = self::$config['httpContext'];

        if ($httpContext->isIgnoredRoute()) {
            $request = $httpContext->getRequest();
            $response = $httpContext->getResponse();
            $response->clear();

            if (!file_exists($request->documentRoot() . $request->path())) {
                $response->setStatusCode(404);
            }
            else {
                require($request->documentRoot() . $request->path());
            }

            $response->end();
            return false;
        }

        $route = $httpContext->getRoute();

        if ($route == null) {
            $response = $httpContext->getResponse();
            $response->setStatusCode(404);
            $response->end();
            return false;
        }

        return $route;
    }
private static function canRoute() {
        $httpContext = self::$config['httpContext'];

        if ($httpContext->isIgnoredRoute()) {
            $request = $httpContext->getRequest();
            $response = $httpContext->getResponse();
            $response->clear();

            if (!file_exists($request->documentRoot() . $request->path())) {
                $response->setStatusCode(404);
            }
            else {
                require($request->documentRoot() . $request->path());
            }

            $response->end();
            return false;
        }

        $route = $httpContext->getRoute();

        if ($route == null) {
            $response = $httpContext->getResponse();
            $response->setStatusCode(404);
            $response->end();
            return false;
        }

        return $route;
    }
private static function canRoute ( ) { $ httpContext = self :: $ config [ 'httpContext' ] ; if ( $ httpContext -> isIgnoredRoute ( ) ) { $ request = $ httpContext -> getRequest ( ) ; $ response = $ httpContext -> getResponse ( ) ; $ response -> clear ( ) ; if ( ! file_exists ( $ request -> documentRoot ( ) . $ request -> path ( ) ) ) { $ response -> setStatusCode ( 404 ) ; } else { require ( $ request -> documentRoot ( ) . $ request -> path ( ) ) ; } $ response -> end ( ) ; return false ; } $ route = $ httpContext -> getRoute ( ) ; if ( $ route == null ) { $ response = $ httpContext -> getResponse ( ) ; $ response -> setStatusCode ( 404 ) ; $ response -> end ( ) ; return false ; } return $ route ; }
Looks for a suitable route and checks whether the request can be executed.

@return Route|bool
Looks for a suitable route and checks whether the request can be executed .