Skip to content

Commit 295c828

Browse files
authored
GuzzleStreamFactory: support guzzle/psr7 version 2 (#141)
1 parent 887734d commit 295c828

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ All notable changes to this project will be documented in this file.
66
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
77
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
88

9+
## [1.11.2] - 2021-08-03
10+
11+
- Support GuzzleHttp/Psr7 version 2.0 in the (deprecated) GuzzleStreamFactory.
12+
913
## [1.11.1] - 2021-05-24
1014

1115
- Support GuzzleHttp/Psr7 version 2.0 in the (deprecated) GuzzleUriFactory.

src/StreamFactory/GuzzleStreamFactory.php

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Http\Message\StreamFactory;
44

5+
use GuzzleHttp\Psr7\Utils;
56
use Http\Message\StreamFactory;
67

78
/**
@@ -18,6 +19,10 @@ final class GuzzleStreamFactory implements StreamFactory
1819
*/
1920
public function createStream($body = null)
2021
{
22+
if (class_exists(Utils::class)) {
23+
return Utils::streamFor($body);
24+
}
25+
2126
return \GuzzleHttp\Psr7\stream_for($body);
2227
}
2328
}

0 commit comments

Comments
 (0)