function PumpStream::__construct
Parameters
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 or EOF.
array{size?: int, metadata?: array} $options Stream options::
- metadata: Hash of metadata to use with stream.
- size: Size of the stream, if known.
File
-
vendor/
guzzlehttp/ psr7/ src/ PumpStream.php, line 46
Class
- PumpStream
- Provides a read only stream that pumps data from a PHP callable.
Namespace
GuzzleHttp\Psr7Code
public function __construct(callable $source, array $options = []) {
$this->source = $source;
$this->size = $options['size'] ?? null;
$this->metadata = $options['metadata'] ?? [];
$this->buffer = new BufferStream();
}