public function getRoute(): RouteInterface
    {
        // Find route by regexp and URI
        $matches = $this->getMatches();

        // Cleanup the array of matches, then reindex array
        $matches = array_values(array_filter($matches));

        // If we have some classes in result of regexp
        $result = !empty($matches)
            // Take first from matches
            ? $matches[0] // Here the Route() object
            // Create new object with error inside
            : $this->getError();

        return $result;
    }
public function getRoute(): RouteInterface
    {
        // Find route by regexp and URI
        $matches = $this->getMatches();

        // Cleanup the array of matches, then reindex array
        $matches = array_values(array_filter($matches));

        // If we have some classes in result of regexp
        $result = !empty($matches)
            // Take first from matches
            ? $matches[0] // Here the Route() object
            // Create new object with error inside
            : $this->getError();

        return $result;
    }
public function getRoute ( ) : RouteInterface { // Find route by regexp and URI $ matches = $ this -> getMatches ( ) ; // Cleanup the array of matches, then reindex array $ matches = array_values ( array_filter ( $ matches ) ) ; // If we have some classes in result of regexp $ result = ! empty ( $ matches ) // Take first from matches ? $ matches [ 0 ] // Here the Route() object // Create new object with error inside : $ this -> getError ( ) ; return $ result ; }
Parse URI by Regexp from routes and return single route

@return  RouteInterface
Parse URI by Regexp from routes and return single route