Skip to content

Commit 402fcbc

Browse files
authored
Fix static analysis suppression in RouteCollector::removeNamedRoute() (#3445)
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.
1 parent 025043e commit 402fcbc

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Slim/Routing/RouteCollector.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ public function removeNamedRoute(string $name): RouteCollectorInterface
185185
{
186186
$route = $this->getNamedRoute($name);
187187

188-
/** @psalm-suppress PossiblyNullArrayOffset */
189-
unset($this->routesByName[$route->getName()], $this->routes[$route->getIdentifier()]);
188+
unset($this->routesByName[$name], $this->routes[$route->getIdentifier()]);
190189
return $this;
191190
}
192191

0 commit comments

Comments
 (0)