summaryrefslogtreecommitdiffstats
path: root/Mustache/Parser.php
diff options
context:
space:
mode:
authorSimon Rettberg2023-11-14 14:47:55 +0100
committerSimon Rettberg2023-11-14 14:47:55 +0100
commit06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0 (patch)
tree7e5493b102074672d8cfd8fe1a61e49f080edbe8 /Mustache/Parser.php
parentUpdate phpstorm config (diff)
downloadslx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.gz
slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.tar.xz
slx-admin-06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0.zip
Add function param/return types, fix a lot more phpstorm complaints
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;
}
/**