From be512226511f24360f06378b24f3a8ff640ea4d5 Mon Sep 17 00:00:00 2001 From: Jake Hotson Date: Thu, 17 Jul 2025 01:02:26 +0100 Subject: [PATCH 1/2] [BUGFIX] Correct DocBlock for `ParserState::consumeUntil()` The special `EOF` constant is actually defined as `null`, so the stop characters may be strings or `null`. --- config/phpstan-baseline.neon | 6 ------ src/Parsing/ParserState.php | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon index 982bbbfef..486ed7daa 100644 --- a/config/phpstan-baseline.neon +++ b/config/phpstan-baseline.neon @@ -18,12 +18,6 @@ parameters: count: 1 path: ../src/CSSList/Document.php - - - message: '#^Call to function in_array\(\) with arguments null, list\ and true will always evaluate to false\.$#' - identifier: function.impossibleType - count: 1 - path: ../src/Parsing/ParserState.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue diff --git a/src/Parsing/ParserState.php b/src/Parsing/ParserState.php index e90650d57..111fb459f 100644 --- a/src/Parsing/ParserState.php +++ b/src/Parsing/ParserState.php @@ -328,7 +328,7 @@ public function isEnd(): bool } /** - * @param list|string $stopCharacters + * @param list|string|null $stopCharacters * @param array $comments * * @throws UnexpectedEOFException From d4942fc9eeda3b5276abc8360337d6bee66d193a Mon Sep 17 00:00:00 2001 From: JakeQZ Date: Thu, 17 Jul 2025 19:16:37 +0100 Subject: [PATCH 2/2] Use `EOF` constant in DocBlock rather than `null` Co-authored-by: Oliver Klee --- src/Parsing/ParserState.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Parsing/ParserState.php b/src/Parsing/ParserState.php index 111fb459f..74ad0efef 100644 --- a/src/Parsing/ParserState.php +++ b/src/Parsing/ParserState.php @@ -328,7 +328,7 @@ public function isEnd(): bool } /** - * @param list|string|null $stopCharacters + * @param list|string|self::EOF $stopCharacters * @param array $comments * * @throws UnexpectedEOFException