Skip to content
This repository has been archived by the owner on Dec 31, 2022. It is now read-only.

Commit

Permalink
Removed the StreamFactory::createStreamFromRequestBody() method
Browse files Browse the repository at this point in the history
  • Loading branch information
fenric committed Nov 6, 2018
1 parent 58284ed commit 1159eb0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ $stream = new Stream(fopen(...));
// creates a new stream from the given string
$stream = (new StreamFactory)->createStream('Hello, world!');

// creates a new stream from the request body
$stream = (new StreamFactory)->createStreamFromRequestBody();

// creates a new stream from the given filename or URI
$stream = (new StreamFactory)->createStreamFromFile('http://php.net/', 'rb');

Expand Down
16 changes: 0 additions & 16 deletions src/StreamFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,6 @@ public function createStream(string $content = '') : StreamInterface
return new Stream($resource);
}

/**
* Creates a stream from the request body
*
* @return StreamInterface
*/
public function createStreamFromRequestBody() : StreamInterface
{
$resource = \fopen('php://temp', 'r+b');

\stream_copy_to_stream(\fopen('php://input', 'rb'), $resource);

\rewind($resource);

return new Stream($resource);
}

/**
* {@inheritDoc}
*
Expand Down

0 comments on commit 1159eb0

Please sign in to comment.