Skip to content

Commit

Permalink
Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
iRedds committed Oct 10, 2022
1 parent 1b9d2ec commit ea5c778
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
.phpunit.cache
/vendor
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
### An example implementation of PSR-15.
3 changes: 2 additions & 1 deletion src/RequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class RequestHandler implements RequestHandlerInterface
protected array $handler;
/**
* @param MiddlewareInterface[] $middlewares
* @param array $handler
* @param array $handler // [Controller::class, 'method']
*/
public function __construct(array $middlewares, array $handler)
{
Expand All @@ -30,6 +30,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
return $middleware->process($request, $this);
} else {
[$controller, $method] = $this->handler;

return (new $controller)->$method();
}
}
Expand Down

0 comments on commit ea5c778

Please sign in to comment.