Skip to content

Commit 9cc6f73

Browse files
authored
[CLEANUP] Remove impossible conditional (#1337)
The parameter `$parserState` is specified to be a `ParserState`, so it can never be a string.
1 parent 6039270 commit 9cc6f73

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

config/phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
parameters:
22
ignoreErrors:
3-
-
4-
message: '#^Call to function is_string\(\) with Sabberworm\\CSS\\Parsing\\ParserState will always evaluate to false\.$#'
5-
identifier: function.impossibleType
6-
count: 1
7-
path: ../src/CSSList/CSSList.php
8-
93
-
104
message: '#^Loose comparison via "\=\=" is not allowed\.$#'
115
identifier: equal.notAllowed

src/CSSList/CSSList.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use Sabberworm\CSS\RuleSet\AtRuleSet;
2222
use Sabberworm\CSS\RuleSet\DeclarationBlock;
2323
use Sabberworm\CSS\RuleSet\RuleSet;
24-
use Sabberworm\CSS\Settings;
2524
use Sabberworm\CSS\Value\CSSString;
2625
use Sabberworm\CSS\Value\URL;
2726
use Sabberworm\CSS\Value\Value;
@@ -64,9 +63,6 @@ public function __construct(?int $lineNumber = null)
6463
public static function parseList(ParserState $parserState, CSSList $list): void
6564
{
6665
$isRoot = $list instanceof Document;
67-
if (\is_string($parserState)) {
68-
$parserState = new ParserState($parserState, Settings::create());
69-
}
7066
$usesLenientParsing = $parserState->getSettings()->usesLenientParsing();
7167
$comments = [];
7268
while (!$parserState->isEnd()) {

0 commit comments

Comments
 (0)