diff --git a/Slim/Middleware/RoutingMiddleware.php b/Slim/Middleware/RoutingMiddleware.php index d26222d81..9d1b9fe5c 100644 --- a/Slim/Middleware/RoutingMiddleware.php +++ b/Slim/Middleware/RoutingMiddleware.php @@ -77,7 +77,7 @@ public function performRouting(ServerRequestInterface $request): ServerRequestIn switch ($routeStatus) { case Dispatcher::FOUND: $routeArguments = $routingResults->getRouteArguments(); - $route = $this->router->lookupRoute($routingResults->getRouteHandler()); + $route = $this->router->lookupRoute($routingResults->getRouteIdentifier()); $route->prepare($request, $routeArguments); return $request ->withAttribute('route', $route) diff --git a/Slim/RoutingResults.php b/Slim/RoutingResults.php index 986a88de2..5b1423c51 100644 --- a/Slim/RoutingResults.php +++ b/Slim/RoutingResults.php @@ -42,7 +42,7 @@ class RoutingResults /** * @var null|string */ - protected $routeHandler; + protected $routeIdentifier; /** * @var array @@ -55,7 +55,7 @@ class RoutingResults * @param string $httpMethod * @param string $uri * @param int $routeStatus - * @param string|null $routeHandler + * @param string|null $routeIdentifier * @param array $routeArguments */ public function __construct( @@ -63,14 +63,14 @@ public function __construct( string $httpMethod, string $uri, int $routeStatus, - string $routeHandler = null, + string $routeIdentifier = null, array $routeArguments = [] ) { $this->dispatcher = $dispatcher; $this->httpMethod = $httpMethod; $this->uri = $uri; $this->routeStatus = $routeStatus; - $this->routeHandler = $routeHandler; + $this->routeIdentifier = $routeIdentifier; $this->routeArguments = $routeArguments; } @@ -109,9 +109,9 @@ public function getRouteStatus(): int /** * @return null|string */ - public function getRouteHandler() + public function getRouteIdentifier() { - return $this->routeHandler; + return $this->routeIdentifier; } /** diff --git a/tests/DispatcherTest.php b/tests/DispatcherTest.php index ee1ff5359..8700ee83d 100644 --- a/tests/DispatcherTest.php +++ b/tests/DispatcherTest.php @@ -61,7 +61,7 @@ public function testFoundDispatches($method, $uri, $callback, $handler, $argDict $results = $dispatcher->dispatch($method, $uri); $this->assertSame($dispatcher::FOUND, $results->getRouteStatus()); - $this->assertSame($handler, $results->getRouteHandler()); + $this->assertSame($handler, $results->getRouteIdentifier()); $this->assertSame($argDict, $results->getRouteArguments()); $this->assertSame($method, $results->getHttpMethod()); $this->assertSame($uri, $results->getUri());