Skip to content

Commit

Permalink
Revert #177 (#182)
Browse files Browse the repository at this point in the history
* Revert #177

* update changelog
  • Loading branch information
Nyholm committed Jul 2, 2021
1 parent 2dc58be commit 2212385
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Expand Up @@ -6,7 +6,6 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

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

Expand Down
1 change: 0 additions & 1 deletion src/Stream.php
Expand Up @@ -71,7 +71,6 @@ public static function create($body = ''): StreamInterface
if (\is_string($body)) {
$resource = \fopen('php://temp', 'rw+');
\fwrite($resource, $body);
\rewind($resource);
$body = $resource;
}

Expand Down
3 changes: 2 additions & 1 deletion tests/StreamTest.php
Expand Up @@ -47,7 +47,8 @@ public function testConvertsToString()
public function testBuildFromString()
{
$stream = Stream::create('data');
$this->assertEquals('data', $stream->getContents());
$this->assertEquals('', $stream->getContents());
$this->assertEquals('data', $stream->__toString());
$stream->close();
}

Expand Down

0 comments on commit 2212385

Please sign in to comment.