Skip to content

Commit e77dfa2

Browse files
committed
[TASK] Avoid magic method forwarding in OutputFormat
1 parent 8d66357 commit e77dfa2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/RuleSet/DeclarationBlock.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,21 +155,23 @@ public function __toString(): string
155155
*/
156156
public function render(OutputFormat $outputFormat): string
157157
{
158-
$result = $outputFormat->comments($this);
158+
$formatter = $outputFormat->getFormatter();
159+
$result = $formatter->comments($this);
159160
if (\count($this->selectors) === 0) {
160161
// If all the selectors have been removed, this declaration block becomes invalid
161162
throw new OutputException('Attempt to print declaration block with missing selector', $this->lineNumber);
162163
}
163164
$result .= $outputFormat->getContentBeforeDeclarationBlock();
164-
$result .= $outputFormat->implode(
165-
$outputFormat->spaceBeforeSelectorSeparator() . ',' . $outputFormat->spaceAfterSelectorSeparator(),
165+
$result .= $formatter->implode(
166+
$formatter->spaceBeforeSelectorSeparator() . ',' . $formatter->spaceAfterSelectorSeparator(),
166167
$this->selectors
167168
);
168169
$result .= $outputFormat->getContentAfterDeclarationBlockSelectors();
169-
$result .= $outputFormat->spaceBeforeOpeningBrace() . '{';
170+
$result .= $formatter->spaceBeforeOpeningBrace() . '{';
170171
$result .= $this->renderRules($outputFormat);
171172
$result .= '}';
172173
$result .= $outputFormat->getContentAfterDeclarationBlock();
174+
173175
return $result;
174176
}
175177
}

0 commit comments

Comments
 (0)