/** * @inheritdoc * @param array $matches The list of regex matches */ public function isMatch(ParsedRoute $route, Request $request, array &$matches = []) { $isMatch = preg_match($route->getPathRegex(), $request->getPath(), $matches) === 1; // Remove the subject array_shift($matches); return $isMatch; }
/** * Generates the path portion of a URL for a route * * @param ParsedRoute $route The route whose URL we're generating * @param mixed|array $values The value or list of values to fill the route with * @return string The generated path value * @throws URLException Thrown if the generated path is not valid */ private function generatePath(ParsedRoute $route, &$values) { return $this->generateUrlPart($route->getRawPath(), $route->getPathRegex(), $route->getName(), $values); }