Skip to content

Commit ec3c3ea

Browse files
committed
Fix issue reading from large streams
PregReplaceFilterStream didn't implement eof(), which caused an issue using stream_get_contents on a guzzle resource created out of the stream zbateson/mail-mime-parser#84 zbateson/mail-mime-parser#87
1 parent af46847 commit ec3c3ea

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/PregReplaceFilterStream.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ public function __construct(StreamInterface $stream, $pattern, $replacement)
4646
$this->buffer = new BufferStream();
4747
}
4848

49+
/**
50+
* Returns true if the end of stream has been reached.
51+
*
52+
* @return boolean
53+
*/
54+
public function eof()
55+
{
56+
return ($this->buffer->eof() && $this->stream->eof());
57+
}
58+
4959
/**
5060
* Not supported by PregReplaceFilterStream
5161
*

0 commit comments

Comments
 (0)