From 253aaaf4fa5262ef89dba942c72eebcb809a7b87 Mon Sep 17 00:00:00 2001 From: Niklas Keller Date: Mon, 22 May 2017 08:34:38 +0200 Subject: [PATCH] Add Parser::getBuffer() --- lib/Parser.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/Parser.php b/lib/Parser.php index 32cf6a1..9f2083a 100644 --- a/lib/Parser.php +++ b/lib/Parser.php @@ -46,6 +46,16 @@ class Parser implements OutputStream { } } + /** + * Allows inspecting the current buffer. This might be required to get the remaining buffer data in case an input + * stream ends and there's still something in the buffer. + * + * @return string + */ + public function getBuffer(): string { + return $this->buffer; + } + /** * Cancels the generator parser and returns any remaining data in the internal buffer. Writing data after calling * this method will result in an error.