diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon index 853c246c3..f30159bea 100644 --- a/config/phpstan-baseline.neon +++ b/config/phpstan-baseline.neon @@ -1,11 +1,5 @@ parameters: ignoreErrors: - - - message: '#^Only booleans are allowed in an if condition, string given\.$#' - identifier: if.condNotBoolean - count: 1 - path: ../src/CSSList/AtRuleBlockList.php - - message: '#^Call to function is_string\(\) with Sabberworm\\CSS\\Parsing\\ParserState will always evaluate to false\.$#' identifier: function.impossibleType @@ -54,12 +48,6 @@ parameters: count: 1 path: ../src/Parsing/ParserState.php - - - message: '#^Only booleans are allowed in an if condition, Sabberworm\\CSS\\Value\\RuleValueList\|string\|null given\.$#' - identifier: if.condNotBoolean - count: 1 - path: ../src/Rule/Rule.php - - message: '#^Parameters should have "string" types as the only types passed to this method$#' identifier: typePerfect.narrowPublicClassMethodParamType diff --git a/src/CSSList/AtRuleBlockList.php b/src/CSSList/AtRuleBlockList.php index e9487cf25..b711a04e3 100644 --- a/src/CSSList/AtRuleBlockList.php +++ b/src/CSSList/AtRuleBlockList.php @@ -55,7 +55,7 @@ public function render(OutputFormat $outputFormat): string $result = $formatter->comments($this); $result .= $outputFormat->getContentBeforeAtRuleBlock(); $arguments = $this->arguments; - if ($arguments) { + if ($arguments !== '') { $arguments = ' ' . $arguments; } $result .= "@{$this->type}$arguments{$formatter->spaceBeforeOpeningBrace()}{"; diff --git a/src/Rule/Rule.php b/src/Rule/Rule.php index 2ccfa7c17..8e2e81d05 100644 --- a/src/Rule/Rule.php +++ b/src/Rule/Rule.php @@ -158,7 +158,7 @@ public function addValue($value, string $type = ' '): void if (!($this->value instanceof RuleValueList) || $this->value->getListSeparator() !== $type) { $currentValue = $this->value; $this->value = new RuleValueList($type, $this->getLineNumber()); - if ($currentValue) { + if ($currentValue !== null && $currentValue !== '') { $this->value->addListComponent($currentValue); } }