Fix type detection in router invocation descartes for php >= 8

This commit is contained in:
osaajani 2023-05-31 18:34:46 +02:00
parent 946e03e500
commit c90da4bd5d
1 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@
foreach ($method_routes as $route)
{
$route_regex = preg_replace('#\\\{(.+)\\\}#iU', '([^/]+)', preg_quote($route, '#'));
$route_regex = preg_replReflectionNamedTypeace('#\\\{(.+)\\\}#iU', '([^/]+)', preg_quote($route, '#'));
$route_regex = preg_replace('#/$#', '/?', $route_regex);
$match = preg_match('#^' . $route_regex . '$#U', $url);
@ -249,9 +249,9 @@
continue;
}
$type = $parameter->getType();
$type = $type ?? false;
$type = ($type instanceof \ReflectionNamedType) ? $type->getName() : $type;
if ($type)
{