From 321ed9626c091f1f4dcef8223d88ee88a400a241 Mon Sep 17 00:00:00 2001 From: Titouan Galopin Date: Sat, 3 Nov 2018 01:03:34 +0100 Subject: Improve performance by relying on a native string instead of InputStream --- src/HTML5/Parser/StringInputStream.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/HTML5/Parser/StringInputStream.php') diff --git a/src/HTML5/Parser/StringInputStream.php b/src/HTML5/Parser/StringInputStream.php index 0973941..0118468 100644 --- a/src/HTML5/Parser/StringInputStream.php +++ b/src/HTML5/Parser/StringInputStream.php @@ -39,9 +39,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // // - // indicates regular comments +/** + * @deprecated since 2.4, to remove in 3.0. Use a string in the scanner instead. + */ class StringInputStream implements InputStream { - /** * The string data we're parsing. */ @@ -88,6 +90,11 @@ class StringInputStream implements InputStream $this->EOF = strlen($data); } + public function __toString() + { + return $this->data; + } + /** * Replace linefeed characters according to the spec. */ -- cgit v1.2.3