Skip to content

Commit 13f1ff5

Browse files
authored
[CLEANUP] Avoid magic method forwarding in Rule (#1150)
Part of #1147
1 parent 4e54a8e commit 13f1ff5

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
@@ -144,18 +144,6 @@ parameters:
144144
count: 1
145145
path: ../src/Property/Import.php
146146

147-
-
148-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:comments\(\)\.$#'
149-
identifier: method.notFound
150-
count: 1
151-
path: ../src/Rule/Rule.php
152-
153-
-
154-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:spaceAfterRuleName\(\)\.$#'
155-
identifier: method.notFound
156-
count: 1
157-
path: ../src/Rule/Rule.php
158-
159147
-
160148
message: '#^Only booleans are allowed in an if condition, Sabberworm\\CSS\\Value\\RuleValueList\|string\|null given\.$#'
161149
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)