From 87e9a39eb26308d1812a0d4d427f95edec62dc9a Mon Sep 17 00:00:00 2001 From: Jake Hotson Date: Wed, 16 Jul 2025 00:46:04 +0100 Subject: [PATCH] [CLEANUP] Remove impossible conditional The parameter `$parserState` is specified to be a `ParserState`, so it can never be a string. --- config/phpstan-baseline.neon | 6 ------ src/CSSList/CSSList.php | 4 ---- 2 files changed, 10 deletions(-) diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon index e96a6ae21..da4b990c9 100644 --- a/config/phpstan-baseline.neon +++ b/config/phpstan-baseline.neon @@ -1,11 +1,5 @@ parameters: ignoreErrors: - - - message: '#^Call to function is_string\(\) with Sabberworm\\CSS\\Parsing\\ParserState will always evaluate to false\.$#' - identifier: function.impossibleType - count: 1 - path: ../src/CSSList/CSSList.php - - message: '#^Loose comparison via "\=\=" is not allowed\.$#' identifier: equal.notAllowed diff --git a/src/CSSList/CSSList.php b/src/CSSList/CSSList.php index 826581a2f..5224415c0 100644 --- a/src/CSSList/CSSList.php +++ b/src/CSSList/CSSList.php @@ -21,7 +21,6 @@ use Sabberworm\CSS\RuleSet\AtRuleSet; use Sabberworm\CSS\RuleSet\DeclarationBlock; use Sabberworm\CSS\RuleSet\RuleSet; -use Sabberworm\CSS\Settings; use Sabberworm\CSS\Value\CSSString; use Sabberworm\CSS\Value\URL; use Sabberworm\CSS\Value\Value; @@ -64,9 +63,6 @@ public function __construct(?int $lineNumber = null) public static function parseList(ParserState $parserState, CSSList $list): void { $isRoot = $list instanceof Document; - if (\is_string($parserState)) { - $parserState = new ParserState($parserState, Settings::create()); - } $usesLenientParsing = $parserState->getSettings()->usesLenientParsing(); $comments = []; while (!$parserState->isEnd()) {