From 35678d61459f06c90c05ca80b3116331672d7db9 Mon Sep 17 00:00:00 2001 From: oscarotero Date: Wed, 24 Jan 2018 22:50:28 +0100 Subject: [PATCH] fixed docs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 44f39ee..de5c4a7 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ $dispatcher = new Dispatcher([ $response = $dispatcher->dispatch(new ServerRequest('/hello/world')); ``` -When the request handler is invoked, it expects a request attribute to be defined that contains a reference to the handler. The handler must be a string, a `Closure` or an object implementing `MiddlewareInterface` or `RequestHandlerInterface`. If it's a string, a `ContainerInterface` will be used to resolve it and get the `MiddlewareInterface` or `RequestHandlerInterface` to use. If it's a `Closure`, will be converted automatically to `MiddlewareInterface` using the [middlewares/utils CallableHandler](https://github.com/middlewares/utils#callablehandler) +When the request handler is invoked, it expects a request attribute to be defined that contains a reference to the handler. The handler must be a string, a `Closure` or an object implementing `MiddlewareInterface` or `RequestHandlerInterface`. If it's a string, a `ContainerInterface` will be used to resolve it and get the `MiddlewareInterface` or `RequestHandlerInterface` to use. If it's a `Closure`, will be converted automatically to `MiddlewareInterface` using the [`Middlewares\Utils\CallableHandler`](https://github.com/middlewares/utils#callablehandler) ```php // Use a PSR-11 container to create the intances of the request handlers @@ -73,7 +73,7 @@ $dispatcher = new Dispatcher([ ## Options -### `__construct(Psr\Container\ContainerInterface $container)` +### `__construct(Psr\Container\ContainerInterface $container = null)` The container instance to resolve the handlers if they are provided as strings. By default will use [`Middlewares\Utils\RequestHandlerContainer`](https://github.com/middlewares/utils/blob/master/src/RequestHandlerContainer.php).