Skip to content

Commit

Permalink
fix: TypeError in DefinedRouteCollector::collect()
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Jun 12, 2024
1 parent 042525c commit 4e35d38
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions system/Router/DefinedRouteCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public function collect(): Generator
$routes = $this->routeCollection->getRoutes($method);

foreach ($routes as $route => $handler) {
// The route key should be a string, but it is stored as an array key,
// it might be an integer.
$route = (string) $route;

if (is_string($handler) || $handler instanceof Closure) {
if ($handler instanceof Closure) {
$view = $this->routeCollection->getRoutesOptions($route, $method)['view'] ?? false;
Expand Down

0 comments on commit 4e35d38

Please sign in to comment.