From 842b31b4778f0190610de6bb36fa5962523ae549 Mon Sep 17 00:00:00 2001 From: steve Date: Thu, 19 Jun 2014 11:29:21 -0700 Subject: [PATCH] clean up Tokenizer->scan -- add error annotation, spaces between +, strict type checking, and self instead of Mustache_Tokenizer --- src/Mustache/Tokenizer.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Mustache/Tokenizer.php b/src/Mustache/Tokenizer.php index 9e7eb4b..f8b7608 100644 --- a/src/Mustache/Tokenizer.php +++ b/src/Mustache/Tokenizer.php @@ -84,6 +84,8 @@ class Mustache_Tokenizer /** * Scan and tokenize template source. * + * @throws Mustache_Exception_SyntaxException when mismatched section tags are encountered. + * * @param string $text Mustache template source to tokenize * @param string $delimiters Optionally, pass initial opening and closing delimiters (default: null) * @@ -163,12 +165,12 @@ class Mustache_Tokenizer if ($this->tagType === self::T_UNESCAPED) { // Clean up `{{{ tripleStache }}}` style tokens. if ($this->ctag === '}}') { - if (($i+2 < $len) && $text[$i+2] == '}') { + if (($i+2 < $len) && $text[$i + 2] === '}') { $i++; } else { $msg = sprintf( 'Uneven closing tag encountered: on line %d', - $token[Mustache_Tokenizer::LINE] + $token[self::LINE] ); throw new Mustache_Exception_SyntaxException($msg, $token);