Skip to content

Commit 4e35d38

Browse files
committed
fix: TypeError in DefinedRouteCollector::collect()
1 parent 042525c commit 4e35d38

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

system/Router/DefinedRouteCollector.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ public function collect(): Generator
3838
$routes = $this->routeCollection->getRoutes($method);
3939

4040
foreach ($routes as $route => $handler) {
41+
// The route key should be a string, but it is stored as an array key,
42+
// it might be an integer.
43+
$route = (string) $route;
44+
4145
if (is_string($handler) || $handler instanceof Closure) {
4246
if ($handler instanceof Closure) {
4347
$view = $this->routeCollection->getRoutesOptions($route, $method)['view'] ?? false;

0 commit comments

Comments
 (0)