diff --git a/config/phpstan-baseline.neon b/config/phpstan-baseline.neon index 435a4cd3b..8af861d56 100644 --- a/config/phpstan-baseline.neon +++ b/config/phpstan-baseline.neon @@ -150,18 +150,6 @@ parameters: count: 1 path: ../src/Rule/Rule.php - - - message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:comments\(\)\.$#' - identifier: method.notFound - count: 1 - path: ../src/RuleSet/AtRuleSet.php - - - - message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:spaceBeforeOpeningBrace\(\)\.$#' - identifier: method.notFound - count: 1 - path: ../src/RuleSet/AtRuleSet.php - - message: '#^Only booleans are allowed in an if condition, string given\.$#' identifier: if.condNotBoolean diff --git a/src/RuleSet/AtRuleSet.php b/src/RuleSet/AtRuleSet.php index c8fb79e33..a896246b9 100644 --- a/src/RuleSet/AtRuleSet.php +++ b/src/RuleSet/AtRuleSet.php @@ -63,12 +63,13 @@ public function __toString(): string public function render(OutputFormat $outputFormat): string { - $result = $outputFormat->comments($this); + $formatter = $outputFormat->getFormatter(); + $result = $formatter->comments($this); $arguments = $this->arguments; if ($arguments) { $arguments = ' ' . $arguments; } - $result .= "@{$this->type}$arguments{$outputFormat->spaceBeforeOpeningBrace()}{"; + $result .= "@{$this->type}$arguments{$formatter->spaceBeforeOpeningBrace()}{"; $result .= $this->renderRules($outputFormat); $result .= '}'; return $result;