src/Util/Ant/AntPathStringMatcher.php
public function matchStrings($str, &$uriTemplateVariables)
    {
        $matches = array();
        if (preg_match_all($this->pattern, $str, $matches, PREG_PATTERN_ORDER)) {
            if ($uriTemplateVariables !== null) {
                array_shift($matches);
                if (count($this->variableNames) != count($matches)) {
                    throw new \Exception(
                        "The number of capturing groups in the pattern segment ".$this->pattern
                        . " does not match the number of URI template variables it defines, which can occur if"
                        . " capturing groups are used in a URI template regex. Use non-capturing groups instead."
                    );
                }
                for ($i = 0; $i < count($matches); $i++) {
                    $uriTemplateVariables[$this->variableNames[$i]] = $matches[$i][0];
                }
            }
            return true;
        } else {
            return false;
        }
    }
public function matchStrings($str, &$uriTemplateVariables)
    {
        $matches = array();
        if (preg_match_all($this->pattern, $str, $matches, PREG_PATTERN_ORDER)) {
            if ($uriTemplateVariables !== null) {
                array_shift($matches);
                if (count($this->variableNames) != count($matches)) {
                    throw new \Exception(
                        "The number of capturing groups in the pattern segment ".$this->pattern
                        . " does not match the number of URI template variables it defines, which can occur if"
                        . " capturing groups are used in a URI template regex. Use non-capturing groups instead."
                    );
                }
                for ($i = 0; $i < count($matches); $i++) {
                    $uriTemplateVariables[$this->variableNames[$i]] = $matches[$i][0];
                }
            }
            return true;
        } else {
            return false;
        }
    }
public function matchStrings ( $ str , & $ uriTemplateVariables ) { $ matches = array ( ) ; if ( preg_match_all ( $ this -> pattern , $ str , $ matches , PREG_PATTERN_ORDER ) ) { if ( $ uriTemplateVariables !== null ) { array_shift ( $ matches ) ; if ( count ( $ this -> variableNames ) != count ( $ matches ) ) { throw new \ Exception ( "The number of capturing groups in the pattern segment " . $ this -> pattern . " does not match the number of URI template variables it defines, which can occur if" . " capturing groups are used in a URI template regex. Use non-capturing groups instead." ) ; } for ( $ i = 0 ; $ i < count ( $ matches ) ; $ i ++ ) { $ uriTemplateVariables [ $ this -> variableNames [ $ i ] ] = $ matches [ $ i ] [ 0 ] ; } } return true ; } else { return false ; } }
Main entry point of the AntPathStringMatcher.
@param string $str                  The string to match
@param array  $uriTemplateVariables The array in which to write the matched variables
@throws \Exception
@return boolean {@code true} if the string matches against the pattern, or {@code false} otherwise
Main entry point of the AntPathStringMatcher .