We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb13da8 commit f8a2198Copy full SHA for f8a2198
README.md
@@ -70,6 +70,7 @@ declare(strict_types=1);
70
use Lcobucci\ContentNegotiation\ContentTypeMiddleware;
71
use Lcobucci\ContentNegotiation\Formatter\Json;
72
use Lcobucci\ContentNegotiation\Formatter\StringCast;
73
+use Zend\Diactoros\StreamFactory;
74
75
$middleware = ContentTypeMiddleware::fromRecommendedSettings(
76
// First argument is the list of formats you want to support:
@@ -98,7 +99,10 @@ $middleware = ContentTypeMiddleware::fromRecommendedSettings(
98
99
[
100
'application/json' => new Json(),
101
'text/html' => new StringCast(),
- ]
102
+ ],
103
+
104
+ // The last argument is any implementation for the StreamFactoryInterface (PSR-17)
105
+ new StreamFactory()
106
);
107
```
108
0 commit comments