From 30bc979fcb1cc7589ed6b2cc2352187713c30f47 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 7 Sep 2018 01:37:07 +0200 Subject: [PATCH] Use instance variable directly instead of passing it around --- framework/core/src/Http/ControllerRouteHandler.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/framework/core/src/Http/ControllerRouteHandler.php b/framework/core/src/Http/ControllerRouteHandler.php index 58c7d0550..78e795d86 100644 --- a/framework/core/src/Http/ControllerRouteHandler.php +++ b/framework/core/src/Http/ControllerRouteHandler.php @@ -46,7 +46,7 @@ class ControllerRouteHandler */ public function __invoke(ServerRequestInterface $request, array $routeParams) { - $controller = $this->resolveController($this->controller); + $controller = $this->resolveController(); $request = $request->withQueryParams(array_merge($request->getQueryParams(), $routeParams)); @@ -54,15 +54,14 @@ class ControllerRouteHandler } /** - * @param string|callable $class * @return RequestHandlerInterface */ - protected function resolveController($class) + protected function resolveController() { - if (is_callable($class)) { - $controller = $this->container->call($class); + if (is_callable($this->controller)) { + $controller = $this->container->call($this->controller); } else { - $controller = $this->container->make($class); + $controller = $this->container->make($this->controller); } if (! ($controller instanceof RequestHandlerInterface)) {