提交的内容
This commit is contained in:
10
vendor/guzzlehttp/psr7/src/PumpStream.php
vendored
Executable file → Normal file
10
vendor/guzzlehttp/psr7/src/PumpStream.php
vendored
Executable file → Normal file
@ -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
|
||||
@ -150,8 +150,6 @@ final class PumpStream implements StreamInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getMetadata($key = null)
|
||||
@ -165,9 +163,9 @@ 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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user