From c7252275d0b67b254ce46788c8b47e72fb470c1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Pr=C3=A9vot?= Date: Sun, 10 Jul 2022 12:28:23 +0200 Subject: [PATCH] Support recent guzzlehttp/psr7 --- composer.json | 2 +- src/BaseTest.php | 2 +- tests/Guzzle/StreamTest.php | 2 +- tests/Guzzle/UploadedFileTest.php | 2 +- tests/RingCentral/StreamTest.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index e80f2f0..89ebc89 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "psr/http-message": "^1.0" }, "require-dev": { - "guzzlehttp/psr7": "^1.4", + "guzzlehttp/psr7": "^1.7 || ^2.0", "laminas/laminas-diactoros": "^2.1", "nyholm/psr7": "^1.0", "ringcentral/psr7": "^1.2", diff --git a/src/BaseTest.php b/src/BaseTest.php index 2afcea5..43dd292 100644 --- a/src/BaseTest.php +++ b/src/BaseTest.php @@ -76,7 +76,7 @@ protected function buildStream($data) } if (class_exists(GuzzleStream::class)) { - return \GuzzleHttp\Psr7\stream_for($data); + return \GuzzleHttp\Psr7\Utils::streamFor($data); } if (class_exists(ZendStream::class)) { diff --git a/tests/Guzzle/StreamTest.php b/tests/Guzzle/StreamTest.php index 26c90a5..f71329f 100644 --- a/tests/Guzzle/StreamTest.php +++ b/tests/Guzzle/StreamTest.php @@ -8,6 +8,6 @@ class StreamTest extends StreamIntegrationTest { public function createStream($data) { - return \GuzzleHttp\Psr7\stream_for($data); + return \GuzzleHttp\Psr7\Utils::streamFor($data); } } diff --git a/tests/Guzzle/UploadedFileTest.php b/tests/Guzzle/UploadedFileTest.php index 486e42a..9ef6326 100644 --- a/tests/Guzzle/UploadedFileTest.php +++ b/tests/Guzzle/UploadedFileTest.php @@ -9,7 +9,7 @@ class UploadedFileTest extends UploadedFileIntegrationTest { public function createSubject() { - $stream = \GuzzleHttp\Psr7\stream_for('Foobar'); + $stream = \GuzzleHttp\Psr7\Utils::streamFor('Foobar'); return new UploadedFile($stream, $stream->getSize(), UPLOAD_ERR_OK, 'filename.txt', 'text/plain'); } diff --git a/tests/RingCentral/StreamTest.php b/tests/RingCentral/StreamTest.php index 0c3532b..6786219 100644 --- a/tests/RingCentral/StreamTest.php +++ b/tests/RingCentral/StreamTest.php @@ -8,6 +8,6 @@ class StreamTest extends StreamIntegrationTest { public function createStream($data) { - return \RingCentral\Psr7\stream_for($data); + return \RingCentral\Psr7\Utils::streamFor($data); } }