Skip to content

Commit

Permalink
fixed docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Jan 24, 2018
1 parent 0519f8e commit 35678d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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).

Expand Down

0 comments on commit 35678d6

Please sign in to comment.