diff --git a/composer.json b/composer.json index 32f2e38..a2b0125 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "php-http/client-implementation": "^1.0", "php-http/httplug": ">=1.0", "php-http/discovery": "^1.0", - "guzzlehttp/psr7": "^1.4.2", + "guzzlehttp/psr7": "^1.4.2|^2.0", "php-http/message": "^1.0" }, "require-dev" : { diff --git a/src/DocumentFactory.php b/src/DocumentFactory.php index 3e77422..205e191 100644 --- a/src/DocumentFactory.php +++ b/src/DocumentFactory.php @@ -5,10 +5,10 @@ namespace TheCodingMachine\Gotenberg; use GuzzleHttp\Psr7\LazyOpenStream; +use GuzzleHttp\Psr7\Stream; use Psr\Http\Message\StreamInterface; use function fopen; use function fwrite; -use function GuzzleHttp\Psr7\stream_for; final class DocumentFactory { @@ -36,6 +36,6 @@ public static function makeFromString(string $fileName, string $string): Documen throw FilesystemException::createFromPhpError(); } - return new Document($fileName, stream_for($fileStream)); + return new Document($fileName, new Stream($fileStream)); } }