From b81c1d5267e1d79bd1dc253bae3038e9a6e92019 Mon Sep 17 00:00:00 2001 From: Rob Allen Date: Thu, 21 May 2026 11:41:08 +0100 Subject: [PATCH] Fix static analysis suppression in RouteCollector::removeNamedRoute() Remove static analysis suppression about using null as an array key (PHP 8.5 deprecation warning), by passing $name directly as it's a string, whereas $route->getName() is string|null. --- Slim/Routing/RouteCollector.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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; }