Skip to content

Commit 4e54a8e

Browse files
authored
[CLEANUP] Avoid magic method forwarding in ValueList (#1149)
Part of #1147
1 parent a389a84 commit 4e54a8e

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

config/phpstan-baseline.neon

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -371,21 +371,3 @@ parameters:
371371
identifier: typePerfect.narrowPublicClassMethodParamType
372372
count: 1
373373
path: ../src/Value/Size.php
374-
375-
-
376-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:implode\(\)\.$#'
377-
identifier: method.notFound
378-
count: 1
379-
path: ../src/Value/ValueList.php
380-
381-
-
382-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:spaceAfterListArgumentSeparator\(\)\.$#'
383-
identifier: method.notFound
384-
count: 1
385-
path: ../src/Value/ValueList.php
386-
387-
-
388-
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:spaceBeforeListArgumentSeparator\(\)\.$#'
389-
identifier: method.notFound
390-
count: 1
391-
path: ../src/Value/ValueList.php

src/Value/ValueList.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,11 @@ public function __toString(): string
9393

9494
public function render(OutputFormat $outputFormat): string
9595
{
96-
return $outputFormat->implode(
97-
$outputFormat->spaceBeforeListArgumentSeparator($this->separator) . $this->separator
98-
. $outputFormat->spaceAfterListArgumentSeparator($this->separator),
96+
$formatter = $outputFormat->getFormatter();
97+
98+
return $formatter->implode(
99+
$formatter->spaceBeforeListArgumentSeparator($this->separator) . $this->separator
100+
. $formatter->spaceAfterListArgumentSeparator($this->separator),
99101
$this->components
100102
);
101103
}

0 commit comments

Comments
 (0)