diff --git a/Slim/Routing/RouteCollector.php b/Slim/Routing/RouteCollector.php index 07d85cfb9..3773343ff 100644 --- a/Slim/Routing/RouteCollector.php +++ b/Slim/Routing/RouteCollector.php @@ -185,8 +185,7 @@ public function removeNamedRoute(string $name): RouteCollectorInterface { $route = $this->getNamedRoute($name); - /** @psalm-suppress PossiblyNullArrayOffset */ - unset($this->routesByName[$route->getName()], $this->routes[$route->getIdentifier()]); + unset($this->routesByName[$name], $this->routes[$route->getIdentifier()]); return $this; }