updated-packages
This commit is contained in:
23
vendor/guzzlehttp/psr7/src/PumpStream.php
vendored
23
vendor/guzzlehttp/psr7/src/PumpStream.php
vendored
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace GuzzleHttp\Psr7;
|
||||
|
||||
use Psr\Http\Message\StreamInterface;
|
||||
@@ -12,6 +13,8 @@ use Psr\Http\Message\StreamInterface;
|
||||
* returned by the provided callable is buffered internally until drained using
|
||||
* the read() function of the PumpStream. The provided callable MUST return
|
||||
* false when there is no more data to read.
|
||||
*
|
||||
* @final
|
||||
*/
|
||||
class PumpStream implements StreamInterface
|
||||
{
|
||||
@@ -31,14 +34,14 @@ class PumpStream implements StreamInterface
|
||||
private $buffer;
|
||||
|
||||
/**
|
||||
* @param callable $source Source of the stream data. The callable MAY
|
||||
* accept an integer argument used to control the
|
||||
* amount of data to return. The callable MUST
|
||||
* return a string when called, or false on error
|
||||
* or EOF.
|
||||
* @param array $options Stream options:
|
||||
* - metadata: Hash of metadata to use with stream.
|
||||
* - size: Size of the stream, if known.
|
||||
* @param callable $source Source of the stream data. The callable MAY
|
||||
* accept an integer argument used to control the
|
||||
* amount of data to return. The callable MUST
|
||||
* return a string when called, or false on error
|
||||
* or EOF.
|
||||
* @param array $options Stream options:
|
||||
* - metadata: Hash of metadata to use with stream.
|
||||
* - size: Size of the stream, if known.
|
||||
*/
|
||||
public function __construct(callable $source, array $options = [])
|
||||
{
|
||||
@@ -51,7 +54,7 @@ class PumpStream implements StreamInterface
|
||||
public function __toString()
|
||||
{
|
||||
try {
|
||||
return copy_to_string($this);
|
||||
return Utils::copyToString($this);
|
||||
} catch (\Exception $e) {
|
||||
return '';
|
||||
}
|
||||
@@ -66,6 +69,8 @@ class PumpStream implements StreamInterface
|
||||
{
|
||||
$this->tellPos = false;
|
||||
$this->source = null;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getSize()
|
||||
|
||||
Reference in New Issue
Block a user