Skip to content

Commit 60957b5

Browse files
committed
[CLEANUP] Avoid magic method forwarding in Color
Part of #1147
1 parent 898d5cd commit 60957b5

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

config/phpstan-baseline.neon

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -294,24 +294,6 @@ parameters:
294294
count: 1
295295
path: ../src/Value/CalcRuleValueList.php
296296

297-
-
298-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:implode\(\)\.$#'
299-
identifier: method.notFound
300-
count: 2
301-
path: ../src/Value/Color.php
302-
303-
-
304-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:spaceAfterListArgumentSeparator\(\)\.$#'
305-
identifier: method.notFound
306-
count: 1
307-
path: ../src/Value/Color.php
308-
309-
-
310-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:spaceBeforeListArgumentSeparator\(\)\.$#'
311-
identifier: method.notFound
312-
count: 1
313-
path: ../src/Value/Color.php
314-
315297
-
316298
message: '#^Call to method Sabberworm\\CSS\\Value\\Color\:\:hasNoneAsComponentValue\(\) with incorrect case\: HasNoneAsComponentValue$#'
317299
identifier: method.nameCase

src/Value/Color.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -383,11 +383,12 @@ private function renderInModernSyntax(OutputFormat $outputFormat): string
383383
unset($componentsWithoutAlpha['a']);
384384
}
385385

386-
$arguments = $outputFormat->implode(' ', $componentsWithoutAlpha);
386+
$formatter = $outputFormat->getFormatter();
387+
$arguments = $formatter->implode(' ', $componentsWithoutAlpha);
387388
if (isset($alpha)) {
388-
$separator = $outputFormat->spaceBeforeListArgumentSeparator('/')
389-
. '/' . $outputFormat->spaceAfterListArgumentSeparator('/');
390-
$arguments = $outputFormat->implode($separator, [$arguments, $alpha]);
389+
$separator = $formatter->spaceBeforeListArgumentSeparator('/')
390+
. '/' . $formatter->spaceAfterListArgumentSeparator('/');
391+
$arguments = $formatter->implode($separator, [$arguments, $alpha]);
391392
}
392393

393394
return $this->getName() . '(' . $arguments . ')';

0 commit comments

Comments
 (0)