mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
N°8834 - Add compatibility with PHP 8.4 (#819)
* N°8834 - Add compatibility with PHP 8.4 * Rollback of scssphp/scssphp version upgrade due to compilation error
This commit is contained in:
@@ -78,8 +78,9 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
public function match(string $pathinfo): array
|
||||
{
|
||||
$this->allow = $this->allowSchemes = [];
|
||||
$pathinfo = '' === ($pathinfo = rawurldecode($pathinfo)) ? '/' : $pathinfo;
|
||||
|
||||
if ($ret = $this->matchCollection(rawurldecode($pathinfo) ?: '/', $this->routes)) {
|
||||
if ($ret = $this->matchCollection($pathinfo, $this->routes)) {
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -87,7 +88,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
throw new NoConfigurationException();
|
||||
}
|
||||
|
||||
throw 0 < \count($this->allow) ? new MethodNotAllowedException(array_unique($this->allow)) : new ResourceNotFoundException(sprintf('No routes found for "%s".', $pathinfo));
|
||||
throw 0 < \count($this->allow) ? new MethodNotAllowedException(array_unique($this->allow)) : new ResourceNotFoundException(\sprintf('No routes found for "%s".', $pathinfo));
|
||||
}
|
||||
|
||||
public function matchRequest(Request $request): array
|
||||
@@ -125,7 +126,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
$method = 'GET';
|
||||
}
|
||||
$supportsTrailingSlash = 'GET' === $method && $this instanceof RedirectableUrlMatcherInterface;
|
||||
$trimmedPathinfo = rtrim($pathinfo, '/') ?: '/';
|
||||
$trimmedPathinfo = '' === ($trimmedPathinfo = rtrim($pathinfo, '/')) ? '/' : $trimmedPathinfo;
|
||||
|
||||
foreach ($routes as $name => $route) {
|
||||
$compiledRoute = $route->compile();
|
||||
@@ -225,7 +226,7 @@ class UrlMatcher implements UrlMatcherInterface, RequestMatcherInterface
|
||||
$routeParameters = func_get_arg(3);
|
||||
|
||||
if (!\is_array($routeParameters)) {
|
||||
throw new \TypeError(sprintf('"%s": Argument $routeParameters is expected to be an array, got "%s".', __METHOD__, get_debug_type($routeParameters)));
|
||||
throw new \TypeError(\sprintf('"%s": Argument $routeParameters is expected to be an array, got "%s".', __METHOD__, get_debug_type($routeParameters)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user