12 use StreamDecoratorTrait;
28 $diff = $this->maxLength - $this->stream->getSize();
36 if (strlen($string) < $diff) {
37 return $this->stream->write($string);
40 return $this->stream->write(substr($string, 0, $diff));
An exception for terminatinating execution or to throw for unit testing.
Stream decorator that begins dropping data once the size of the underlying stream becomes too full.
write($string)
Write data to the stream.
__construct(StreamInterface $stream, $maxLength)
$stream
PHP stream implementation.