Skip to content

Commit

Permalink
Add information on PSR-17 factory on documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lcobucci committed Jun 23, 2019
1 parent cb13da8 commit f8a2198
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ declare(strict_types=1);
use Lcobucci\ContentNegotiation\ContentTypeMiddleware;
use Lcobucci\ContentNegotiation\Formatter\Json;
use Lcobucci\ContentNegotiation\Formatter\StringCast;
use Zend\Diactoros\StreamFactory;

$middleware = ContentTypeMiddleware::fromRecommendedSettings(
// First argument is the list of formats you want to support:
Expand Down Expand Up @@ -98,7 +99,10 @@ $middleware = ContentTypeMiddleware::fromRecommendedSettings(
[
'application/json' => new Json(),
'text/html' => new StringCast(),
]
],

// The last argument is any implementation for the StreamFactoryInterface (PSR-17)
new StreamFactory()
);
```

Expand Down

0 comments on commit f8a2198

Please sign in to comment.