package and depencies
This commit is contained in:
@@ -35,7 +35,7 @@ class TraceableUrlMatcher extends UrlMatcher
|
||||
|
||||
try {
|
||||
$this->match($pathinfo);
|
||||
} catch (ExceptionInterface $e) {
|
||||
} catch (ExceptionInterface) {
|
||||
}
|
||||
|
||||
return $this->traces;
|
||||
@@ -50,7 +50,7 @@ class TraceableUrlMatcher extends UrlMatcher
|
||||
return $traces;
|
||||
}
|
||||
|
||||
protected function matchCollection(string $pathinfo, RouteCollection $routes)
|
||||
protected function matchCollection(string $pathinfo, RouteCollection $routes): array
|
||||
{
|
||||
// HEAD and GET are equivalent as per RFC
|
||||
if ('HEAD' === $method = $this->context->getMethod()) {
|
||||
@@ -99,7 +99,7 @@ class TraceableUrlMatcher extends UrlMatcher
|
||||
continue;
|
||||
}
|
||||
|
||||
$hasTrailingVar = $trimmedPathinfo !== $pathinfo && preg_match('#\{\w+\}/?$#', $route->getPath());
|
||||
$hasTrailingVar = $trimmedPathinfo !== $pathinfo && preg_match('#\{[\w\x80-\xFF]+\}/?$#', $route->getPath());
|
||||
|
||||
if ($hasTrailingVar && ($hasTrailingSlash || (null === $m = $matches[\count($compiledRoute->getPathVariables())] ?? null) || '/' !== ($m[-1] ?? '/')) && preg_match($regex, $trimmedPathinfo, $m)) {
|
||||
if ($hasTrailingSlash) {
|
||||
@@ -115,7 +115,9 @@ class TraceableUrlMatcher extends UrlMatcher
|
||||
continue;
|
||||
}
|
||||
|
||||
$status = $this->handleRouteRequirements($pathinfo, $name, $route);
|
||||
$attributes = $this->getAttributes($route, $name, array_replace($matches, $hostMatches));
|
||||
|
||||
$status = $this->handleRouteRequirements($pathinfo, $name, $route, $attributes);
|
||||
|
||||
if (self::REQUIREMENT_MISMATCH === $status[0]) {
|
||||
$this->addTrace(sprintf('Condition "%s" does not evaluate to "true"', $route->getCondition()), self::ROUTE_ALMOST_MATCHES, $name, $route);
|
||||
@@ -146,7 +148,7 @@ class TraceableUrlMatcher extends UrlMatcher
|
||||
|
||||
$this->addTrace('Route matches!', self::ROUTE_MATCHES, $name, $route);
|
||||
|
||||
return $this->getAttributes($route, $name, array_replace($matches, $hostMatches, $status[1] ?? []));
|
||||
return array_replace($attributes, $status[1] ?? []);
|
||||
}
|
||||
|
||||
return [];
|
||||
@@ -158,7 +160,7 @@ class TraceableUrlMatcher extends UrlMatcher
|
||||
'log' => $log,
|
||||
'name' => $name,
|
||||
'level' => $level,
|
||||
'path' => null !== $route ? $route->getPath() : null,
|
||||
'path' => $route?->getPath(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user