Skip to content

Commit 2212385

Browse files
authored
Revert #177 (#182)
* Revert #177 * update changelog
1 parent 2dc58be commit 2212385

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

CHANGELOG.md

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ All notable changes to this project will be documented in this file, in reverse
66

77
### Fixed
88

9-
- `Stream::create` with a string needs to rewind the created memory stream.
109
- `Psr17Factory::createStreamFromFile`, `UploadedFile::moveTo`, and
1110
`UploadedFile::getStream` no longer throw `ValueError` in PHP 8.
1211

src/Stream.php

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ public static function create($body = ''): StreamInterface
7171
if (\is_string($body)) {
7272
$resource = \fopen('php://temp', 'rw+');
7373
\fwrite($resource, $body);
74-
\rewind($resource);
7574
$body = $resource;
7675
}
7776

tests/StreamTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public function testConvertsToString()
4747
public function testBuildFromString()
4848
{
4949
$stream = Stream::create('data');
50-
$this->assertEquals('data', $stream->getContents());
50+
$this->assertEquals('', $stream->getContents());
51+
$this->assertEquals('data', $stream->__toString());
5152
$stream->close();
5253
}
5354

0 commit comments

Comments
 (0)