src/Router.php
public function findMatch(array $path, $method)
    {
        usort($this->patterns, ['Jivoo\Utilities', 'prioritySorter']);
        foreach ($this->patterns as $pattern) {
            if ($pattern['method'] != 'ANY' and $pattern['method'] != $method) {
                continue;
            }
            $parameters = $this->applyPattern($pattern['pattern'], $path);
            if (isset($parameters)) {
                return $pattern['route']->withParameters($parameters);
            }
        }
        return null;
    }
public function findMatch(array $path, $method)
    {
        usort($this->patterns, ['Jivoo\Utilities', 'prioritySorter']);
        foreach ($this->patterns as $pattern) {
            if ($pattern['method'] != 'ANY' and $pattern['method'] != $method) {
                continue;
            }
            $parameters = $this->applyPattern($pattern['pattern'], $path);
            if (isset($parameters)) {
                return $pattern['route']->withParameters($parameters);
            }
        }
        return null;
    }
public function findMatch ( array $ path , $ method ) { usort ( $ this -> patterns , [ 'Jivoo\Utilities' , 'prioritySorter' ] ) ; foreach ( $ this -> patterns as $ pattern ) { if ( $ pattern [ 'method' ] != 'ANY' and $ pattern [ 'method' ] != $ method ) { continue ; } $ parameters = $ this -> applyPattern ( $ pattern [ 'pattern' ] , $ path ) ; if ( isset ( $ parameters ) ) { return $ pattern [ 'route' ] -> withParameters ( $ parameters ) ; } } return null ; }
Find a route for a path.

@param string[] $path Path array.
@param string $method Request method.
@return Route|null A route or null if none found.
Find a route for a path .