Skip to content

Commit 08b7a1a

Browse files
committed
[CLEANUP] Avoid magic method forwarding in AtRuleBlockList
Part of #1147
1 parent 46da4b2 commit 08b7a1a

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
@@ -1,17 +1,5 @@
11
parameters:
22
ignoreErrors:
3-
-
4-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:comments\(\)\.$#'
5-
identifier: method.notFound
6-
count: 1
7-
path: ../src/CSSList/AtRuleBlockList.php
8-
9-
-
10-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:spaceBeforeOpeningBrace\(\)\.$#'
11-
identifier: method.notFound
12-
count: 1
13-
path: ../src/CSSList/AtRuleBlockList.php
14-
153
-
164
message: '#^Only booleans are allowed in an if condition, string given\.$#'
175
identifier: if.condNotBoolean

src/CSSList/AtRuleBlockList.php

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

5353
public function render(OutputFormat $outputFormat): string
5454
{
55-
$result = $outputFormat->comments($this);
55+
$formatter = $outputFormat->getFormatter();
56+
$result = $formatter->comments($this);
5657
$result .= $outputFormat->getContentBeforeAtRuleBlock();
5758
$arguments = $this->arguments;
5859
if ($arguments) {
5960
$arguments = ' ' . $arguments;
6061
}
61-
$result .= "@{$this->type}$arguments{$outputFormat->spaceBeforeOpeningBrace()}{";
62+
$result .= "@{$this->type}$arguments{$formatter->spaceBeforeOpeningBrace()}{";
6263
$result .= $this->renderListContents($outputFormat);
6364
$result .= '}';
6465
$result .= $outputFormat->getContentAfterAtRuleBlock();

0 commit comments

Comments
 (0)