Skip to content

Commit

Permalink
Add Parser::getBuffer()
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed May 22, 2017
1 parent 7a20d5b commit 253aaaf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ public function __construct(\Generator $generator) {
}
}

/**
* 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.
Expand Down

0 comments on commit 253aaaf

Please sign in to comment.