Skip to content

Commit 230fd2a

Browse files
authored
[CLEANUP] Avoid magic method forwarding in AtRuleSet (#1153)
Part of #1147
1 parent 08612de commit 230fd2a

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

config/phpstan-baseline.neon

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,18 +126,6 @@ parameters:
126126
count: 1
127127
path: ../src/Rule/Rule.php
128128

129-
-
130-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:comments\(\)\.$#'
131-
identifier: method.notFound
132-
count: 1
133-
path: ../src/RuleSet/AtRuleSet.php
134-
135-
-
136-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:spaceBeforeOpeningBrace\(\)\.$#'
137-
identifier: method.notFound
138-
count: 1
139-
path: ../src/RuleSet/AtRuleSet.php
140-
141129
-
142130
message: '#^Only booleans are allowed in an if condition, string given\.$#'
143131
identifier: if.condNotBoolean

src/RuleSet/AtRuleSet.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@ public function __toString(): string
6363

6464
public function render(OutputFormat $outputFormat): string
6565
{
66-
$result = $outputFormat->comments($this);
66+
$formatter = $outputFormat->getFormatter();
67+
$result = $formatter->comments($this);
6768
$arguments = $this->arguments;
6869
if ($arguments) {
6970
$arguments = ' ' . $arguments;
7071
}
71-
$result .= "@{$this->type}$arguments{$outputFormat->spaceBeforeOpeningBrace()}{";
72+
$result .= "@{$this->type}$arguments{$formatter->spaceBeforeOpeningBrace()}{";
7273
$result .= $this->renderRules($outputFormat);
7374
$result .= '}';
7475
return $result;

0 commit comments

Comments
 (0)