Skip to content

Commit af71971

Browse files
committed
Introduce local variable
1 parent 1ec2d7f commit af71971

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/RuleSet/RuleSet.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,18 +278,18 @@ protected function renderRules(OutputFormat $outputFormat)
278278
$isFirst = true;
279279
$nextLevelFormat = $outputFormat->nextLevel();
280280
foreach ($this->getRules() as $rule) {
281-
$renderedRule = $nextLevelFormat->getFormatter()
282-
->safely(static function () use ($rule, $nextLevelFormat): string {
283-
return $rule->render($nextLevelFormat);
284-
});
281+
$nextLevelFormatter = $nextLevelFormat->getFormatter();
282+
$renderedRule = $nextLevelFormatter->safely(static function () use ($rule, $nextLevelFormat): string {
283+
return $rule->render($nextLevelFormat);
284+
});
285285
if ($renderedRule === null) {
286286
continue;
287287
}
288288
if ($isFirst) {
289289
$isFirst = false;
290-
$result .= $nextLevelFormat->getFormatter()->spaceBeforeRules();
290+
$result .= $nextLevelFormatter->spaceBeforeRules();
291291
} else {
292-
$result .= $nextLevelFormat->getFormatter()->spaceBetweenRules();
292+
$result .= $nextLevelFormatter->spaceBetweenRules();
293293
}
294294
$result .= $renderedRule;
295295
}

0 commit comments

Comments
 (0)