src/main/php/routing/Routing.php
public function findResource($uri, string $requestMethod = null): UriResource
    {
        $calledUri      = CalledUri::castFrom($uri, $requestMethod);
        $matchingRoutes = $this->routes->match($calledUri);
        if ($matchingRoutes->hasExactMatch()) {
            return $this->handleMatchingRoute(
                    $calledUri,
                    $matchingRoutes->exactMatch()
            );
        }

        if ($matchingRoutes->exist()) {
            return $this->handleNonMethodMatchingRoutes(
                    $calledUri,
                    $matchingRoutes
            );
        }

        return new NotFound(
                $this->injector,
                $calledUri,
                $this->collectInterceptors($calledUri),
                $this->supportedMimeTypes()
        );
    }
public function findResource($uri, string $requestMethod = null): UriResource
    {
        $calledUri      = CalledUri::castFrom($uri, $requestMethod);
        $matchingRoutes = $this->routes->match($calledUri);
        if ($matchingRoutes->hasExactMatch()) {
            return $this->handleMatchingRoute(
                    $calledUri,
                    $matchingRoutes->exactMatch()
            );
        }

        if ($matchingRoutes->exist()) {
            return $this->handleNonMethodMatchingRoutes(
                    $calledUri,
                    $matchingRoutes
            );
        }

        return new NotFound(
                $this->injector,
                $calledUri,
                $this->collectInterceptors($calledUri),
                $this->supportedMimeTypes()
        );
    }
public function findResource ( $ uri , string $ requestMethod = null ) : UriResource { $ calledUri = CalledUri :: castFrom ( $ uri , $ requestMethod ) ; $ matchingRoutes = $ this -> routes -> match ( $ calledUri ) ; if ( $ matchingRoutes -> hasExactMatch ( ) ) { return $ this -> handleMatchingRoute ( $ calledUri , $ matchingRoutes -> exactMatch ( ) ) ; } if ( $ matchingRoutes -> exist ( ) ) { return $ this -> handleNonMethodMatchingRoutes ( $ calledUri , $ matchingRoutes ) ; } return new NotFound ( $ this -> injector , $ calledUri , $ this -> collectInterceptors ( $ calledUri ) , $ this -> supportedMimeTypes ( ) ) ; }
returns resource which is applicable for given request

@param   string|\stubbles\webapp\routing\CalledUri  $uri            actually called uri
@param   string                                     $requestMethod  optional when $calledUri is an instance of stubbles\webapp\routing\CalledUri
@return  \stubbles\webapp\routing\UriResource
returns resource which is applicable for given request