summaryrefslogtreecommitdiffstats
path: root/Mustache/Parser.php
diff options
context:
space:
mode:
Diffstat (limited to 'Mustache/Parser.php')
-rw-r--r--Mustache/Parser.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/Mustache/Parser.php b/Mustache/Parser.php
index 5db58244..e5523b24 100644
--- a/Mustache/Parser.php
+++ b/Mustache/Parser.php
@@ -222,7 +222,7 @@ class Mustache_Parser
{
if ($this->lineTokens > 1) {
// this is the third or later node on this line, so it can't be standalone
- return;
+ return null;
}
$prev = null;
@@ -231,7 +231,7 @@ class Mustache_Parser
// unless the previous node is whitespace.
if ($prev = end($nodes)) {
if (!$this->tokenIsWhitespace($prev)) {
- return;
+ return null;
}
}
}
@@ -239,19 +239,19 @@ class Mustache_Parser
if ($next = reset($tokens)) {
// If we're on a new line, bail.
if ($next[Mustache_Tokenizer::LINE] !== $this->lineNum) {
- return;
+ return null;
}
// If the next token isn't whitespace, bail.
if (!$this->tokenIsWhitespace($next)) {
- return;
+ return null;
}
if (count($tokens) !== 1) {
// Unless it's the last token in the template, the next token
// must end in newline for this to be standalone.
if (substr($next[Mustache_Tokenizer::VALUE], -1) !== "\n") {
- return;
+ return null;
}
}
@@ -263,6 +263,7 @@ class Mustache_Parser
// Return the whitespace prefix, if any
return array_pop($nodes);
}
+ return null;
}
/**