Aggiornato Composer
This commit is contained in:
12
vendor/guzzlehttp/psr7/src/PumpStream.php
vendored
12
vendor/guzzlehttp/psr7/src/PumpStream.php
vendored
@@ -18,7 +18,7 @@ use Psr\Http\Message\StreamInterface;
|
||||
*/
|
||||
final class PumpStream implements StreamInterface
|
||||
{
|
||||
/** @var callable|null */
|
||||
/** @var callable(int): (string|false|null)|null */
|
||||
private $source;
|
||||
|
||||
/** @var int|null */
|
||||
@@ -34,7 +34,7 @@ final class PumpStream implements StreamInterface
|
||||
private $buffer;
|
||||
|
||||
/**
|
||||
* @param callable(int): (string|null|false) $source Source of the stream data. The callable MAY
|
||||
* @param callable(int): (string|false|null) $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|null on error
|
||||
@@ -60,6 +60,7 @@ final class PumpStream implements StreamInterface
|
||||
throw $e;
|
||||
}
|
||||
trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR);
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@@ -149,8 +150,6 @@ final class PumpStream implements StreamInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getMetadata($key = null)
|
||||
@@ -164,11 +163,12 @@ final class PumpStream implements StreamInterface
|
||||
|
||||
private function pump(int $length): void
|
||||
{
|
||||
if ($this->source) {
|
||||
if ($this->source !== null) {
|
||||
do {
|
||||
$data = call_user_func($this->source, $length);
|
||||
$data = ($this->source)($length);
|
||||
if ($data === false || $data === null) {
|
||||
$this->source = null;
|
||||
|
||||
return;
|
||||
}
|
||||
$this->buffer->write($data);
|
||||
|
||||
Reference in New Issue
Block a user