private function matchUri(string $regex, string $uri): ?array
    {
        if (preg_match_all('/' . $regex . '/', $uri, $uriMatches)) {
            $uriMatches = array_filter($uriMatches, function ($key) {
                if (is_string($key)) {
                    return true;
                }

                return false;
            }, ARRAY_FILTER_USE_KEY);

            $uriMatches = array_map(function ($match) {
                return $match[0];
            }, $uriMatches);

            return $uriMatches;
        }

        return null;
    }
private function matchUri(string $regex, string $uri): ?array
    {
        if (preg_match_all('/' . $regex . '/', $uri, $uriMatches)) {
            $uriMatches = array_filter($uriMatches, function ($key) {
                if (is_string($key)) {
                    return true;
                }

                return false;
            }, ARRAY_FILTER_USE_KEY);

            $uriMatches = array_map(function ($match) {
                return $match[0];
            }, $uriMatches);

            return $uriMatches;
        }

        return null;
    }
private function matchUri ( string $ regex , string $ uri ) : ? array { if ( preg_match_all ( '/' . $ regex . '/' , $ uri , $ uriMatches ) ) { $ uriMatches = array_filter ( $ uriMatches , function ( $ key ) { if ( is_string ( $ key ) ) { return true ; } return false ; } , ARRAY_FILTER_USE_KEY ) ; $ uriMatches = array_map ( function ( $ match ) { return $ match [ 0 ] ; } , $ uriMatches ) ; return $ uriMatches ; } return null ; }
Matches the URI.

@param string $regex
@param string $uri
@return array|null
Matches the URI .