Skip to content

Commit 1ac927f

Browse files
committed
Improve type handing of Formatter::isClause
Found on Scrutinizer Signed-off-by: William Desportes <williamdes@wdes.fr>
1 parent 95858fb commit 1ac927f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Utils/Formatter.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ public function formatList($list)
454454
// Checking if this clause ended.
455455
$isClause = static::isClause($curr);
456456

457-
if ($isClause) {
457+
if ($isClause !== false) {
458458
if (
459459
($isClause === 2 || $this->options['clause_newline'])
460460
&& empty(self::$SHORT_CLAUSES[$lastClause])
@@ -766,7 +766,8 @@ public static function getGroupLength($list)
766766
*
767767
* @param Token $token the token to be checked
768768
*
769-
* @return int|bool
769+
* @return int|false
770+
* @psalm-return 1|2|false
770771
*/
771772
public static function isClause($token)
772773
{

0 commit comments

Comments
 (0)