Skip to content

Commit 50e03b2

Browse files
committed
[CLEANUP] Avoid magic method forwarding in Rule
Part of #1147
1 parent 46da4b2 commit 50e03b2

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

config/phpstan-baseline.neon

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,18 +156,6 @@ parameters:
156156
count: 1
157157
path: ../src/Property/Import.php
158158

159-
-
160-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:comments\(\)\.$#'
161-
identifier: method.notFound
162-
count: 1
163-
path: ../src/Rule/Rule.php
164-
165-
-
166-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:spaceAfterRuleName\(\)\.$#'
167-
identifier: method.notFound
168-
count: 1
169-
path: ../src/Rule/Rule.php
170-
171159
-
172160
message: '#^Only booleans are allowed in an if condition, Sabberworm\\CSS\\Value\\RuleValueList\|string\|null given\.$#'
173161
identifier: if.condNotBoolean

src/Rule/Rule.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,8 @@ public function __toString(): string
234234

235235
public function render(OutputFormat $outputFormat): string
236236
{
237-
$result = "{$outputFormat->comments($this)}{$this->rule}:{$outputFormat->spaceAfterRuleName()}";
237+
$formatter = $outputFormat->getFormatter();
238+
$result = "{$formatter->comments($this)}{$this->rule}:{$formatter->spaceAfterRuleName()}";
238239
if ($this->value instanceof Value) { // Can also be a ValueList
239240
$result .= $this->value->render($outputFormat);
240241
} else {

0 commit comments

Comments
 (0)