From f8a219813f362766f7ccfcbccfdecb8534ca40d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Sun, 23 Jun 2019 12:52:49 +0200 Subject: [PATCH] Add information on PSR-17 factory on documentation --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e190c8da..093df9c2 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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() ); ```