Skip to content

Commit

Permalink
fix container get
Browse files Browse the repository at this point in the history
  • Loading branch information
s2x committed Jan 13, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 949073d commit 0bb2fba
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/App.php
Original file line number Diff line number Diff line change
@@ -89,7 +89,7 @@ public function process(ServerRequestInterface $request, ResponseInterface $resp
}

foreach (array_reverse($route->getMiddlewares()) as $middleware) {
$controller->addMiddleware($this->container[$middleware]);
$controller->addMiddleware($this->container->get($middleware));
}

return $controller->callMiddlewareStack($request, $response);
2 changes: 1 addition & 1 deletion src/ClosureController.php
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ public function __construct(\Closure $controller)
public function __invoke(
ServerRequestInterface $request,
ResponseInterface $response,
\Closure $next = null
callable $next = null
): ResponseInterface {
return ($this->controller)($request,$response);
}
2 changes: 1 addition & 1 deletion src/Controller.php
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ public function __construct(ControllerInterface $controller)
public function __invoke(
ServerRequestInterface $request,
ResponseInterface $response,
\Closure $next = null
callable $next = null
): ResponseInterface {
return ($this->controller)($request,$response);
}
2 changes: 1 addition & 1 deletion src/Interfaces/MiddlewareInterface.php
Original file line number Diff line number Diff line change
@@ -11,6 +11,6 @@ interface MiddlewareInterface
public function __invoke(
ServerRequestInterface $request,
ResponseInterface $response,
\Closure $next = null
callable $next = null
): ResponseInterface;
}
2 changes: 1 addition & 1 deletion src/Middleware.php
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ trait Middleware
*/
protected $top;

protected function addMiddleware(callable $callable)
public function addMiddleware(callable $callable)
{
if (is_null($this->top)) {
$this->initStack();

0 comments on commit 0bb2fba

Please sign in to comment.