Skip to content

Commit f8a2198

Browse files
committed
Add information on PSR-17 factory on documentation
1 parent cb13da8 commit f8a2198

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ declare(strict_types=1);
7070
use Lcobucci\ContentNegotiation\ContentTypeMiddleware;
7171
use Lcobucci\ContentNegotiation\Formatter\Json;
7272
use Lcobucci\ContentNegotiation\Formatter\StringCast;
73+
use Zend\Diactoros\StreamFactory;
7374

7475
$middleware = ContentTypeMiddleware::fromRecommendedSettings(
7576
// First argument is the list of formats you want to support:
@@ -98,7 +99,10 @@ $middleware = ContentTypeMiddleware::fromRecommendedSettings(
9899
[
99100
'application/json' => new Json(),
100101
'text/html' => new StringCast(),
101-
]
102+
],
103+
104+
// The last argument is any implementation for the StreamFactoryInterface (PSR-17)
105+
new StreamFactory()
102106
);
103107
```
104108

0 commit comments

Comments
 (0)