Skip to content

Commit a3c0685

Browse files
authored
Merge 15ca7dc into fdd1a65
2 parents fdd1a65 + 15ca7dc commit a3c0685

File tree

2 files changed

+6
-34
lines changed

2 files changed

+6
-34
lines changed

config/phpstan-baseline.neon

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -108,36 +108,6 @@ parameters:
108108
count: 1
109109
path: ../src/RuleSet/AtRuleSet.php
110110

111-
-
112-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:comments\(\)\.$#'
113-
identifier: method.notFound
114-
count: 1
115-
path: ../src/RuleSet/DeclarationBlock.php
116-
117-
-
118-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:implode\(\)\.$#'
119-
identifier: method.notFound
120-
count: 1
121-
path: ../src/RuleSet/DeclarationBlock.php
122-
123-
-
124-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:spaceAfterSelectorSeparator\(\)\.$#'
125-
identifier: method.notFound
126-
count: 1
127-
path: ../src/RuleSet/DeclarationBlock.php
128-
129-
-
130-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:spaceBeforeOpeningBrace\(\)\.$#'
131-
identifier: method.notFound
132-
count: 1
133-
path: ../src/RuleSet/DeclarationBlock.php
134-
135-
-
136-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:spaceBeforeSelectorSeparator\(\)\.$#'
137-
identifier: method.notFound
138-
count: 1
139-
path: ../src/RuleSet/DeclarationBlock.php
140-
141111
-
142112
message: '#^Loose comparison via "\!\=" is not allowed\.$#'
143113
identifier: notEqual.notAllowed

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)