Skip to content

Commit

Permalink
Merge pull request #143 from DBCDK/master
Browse files Browse the repository at this point in the history
The Guzzle 7 is complaining about the stream_for method.
  • Loading branch information
Kevinrob authored Jul 2, 2021
2 parents 482b2d7 + e231654 commit 3dc6830
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/CacheEntry.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public function __wakeup()
if ($this->response !== null) {
$this->response = $this->response
->withBody(
\GuzzleHttp\Psr7\stream_for($this->responseBody)
\GuzzleHttp\Psr7\Utils::streamFor($this->responseBody)
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/CacheMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ protected static function addToCache(
// If the body is not seekable, we have to replace it by a seekable one
if (!$response->getBody()->isSeekable()) {
$response = $response->withBody(
\GuzzleHttp\Psr7\stream_for($response->getBody()->getContents())
\GuzzleHttp\Psr7\Utils::streamFor($response->getBody()->getContents())
);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ protected function setUp()
if ($request->getUri()->getPath() === '/no-seek') {
return new FulfilledPromise(
(new Response())
->withBody(new NoSeekStream(\GuzzleHttp\Psr7\stream_for('I am not seekable!')))
->withBody(new NoSeekStream(\GuzzleHttp\Psr7\Utils::streamFor('I am not seekable!')))
->withHeader('Expires', gmdate('D, d M Y H:i:s T', time() + 120))
);
}

return new FulfilledPromise(
(new Response())
->withBody(\GuzzleHttp\Psr7\stream_for('Hello world!'))
->withBody(\GuzzleHttp\Psr7\Utils::streamFor('Hello world!'))
->withHeader('Expires', gmdate('D, d M Y H:i:s T', time() + 120))
);
});
Expand Down

0 comments on commit 3dc6830

Please sign in to comment.