Neos\Flow\Mvc\Routing\DynamicRoutePart::match PHP Метод

match() закрытый публичный Метод

On successful match this method sets $this->value to the corresponding uriPart and shortens $routePath respectively.
final public match ( string &$routePath ) : boolean
$routePath string The request path to be matched - without query parameters, host and fragment.
Результат boolean TRUE if Route Part matched $routePath, otherwise FALSE.
    public final function match(&$routePath)
    {
        $this->value = null;
        if ($this->name === null || $this->name === '') {
            return false;
        }
        $valueToMatch = $this->findValueToMatch($routePath);
        $matchResult = $this->matchValue($valueToMatch);
        if ($matchResult !== true) {
            return $matchResult;
        }
        $this->removeMatchingPortionFromRequestPath($routePath, $valueToMatch);
        return true;
    }

Usage Example

 /**
  * @test
  */
 public function dynamicRoutePartMatchesIfSplitStringContainsMultipleCharactersThatAreFoundInRequestPath()
 {
     $this->dynamicRoutPart->setName('foo');
     $this->dynamicRoutPart->setSplitString('_-_');
     $routePath = 'foo_-_bar';
     $this->assertTrue($this->dynamicRoutPart->match($routePath), 'Dynamic Route Part with a split string of "_-_" should match request path of "foo_-_bar".');
 }