Made sure not to iterate over StaticRoutes again because the key they map to is a specific child Handler
This commit is contained in:
parent
3aca197d7a
commit
bb052625af
|
|
@ -49,7 +49,9 @@ class Router implements HandlerInterface
|
|||
$handler = new $this->routes[$path]();
|
||||
$response = $handler->getResponse($request, $args);
|
||||
} else {
|
||||
foreach ($this->routes as $route) {
|
||||
foreach ($this->routes as $path => $route) {
|
||||
// Only take elements that are not $path => $handler mapped.
|
||||
if (is_int($path)) {
|
||||
/** @var HandlerInterface $route */
|
||||
try {
|
||||
$response = $route->getResponse($request, $args);
|
||||
|
|
@ -61,6 +63,7 @@ class Router implements HandlerInterface
|
|||
if ($response) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($response) {
|
||||
// Check if the router has an error handler for this status code.
|
||||
$status = $response->getStatusCode();
|
||||
|
|
|
|||
Loading…
Reference in New Issue