From 06bff0b9b84d47c43f9bc8aff06a29d85ebb7ed0 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 14 Nov 2023 14:47:55 +0100 Subject: Add function param/return types, fix a lot more phpstorm complaints --- Mustache/Parser.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Mustache/Parser.php') 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; } /** -- cgit v1.2.3-55-g7522