diff --git a/src/Value/CSSFunction.php b/src/Value/CSSFunction.php index 018a9997..f5951bd2 100644 --- a/src/Value/CSSFunction.php +++ b/src/Value/CSSFunction.php @@ -121,10 +121,12 @@ public function render(OutputFormat $outputFormat): string */ public function getArrayRepresentation(): array { - $result = parent::getArrayRepresentation(); - - $result['name'] = $this->name; - - return $result; + return \array_merge( + [ + 'class' => 'placeholder', + 'name' => $this->name, + ], + parent::getArrayRepresentation() + ); } } diff --git a/tests/Unit/Value/ValueTest.php b/tests/Unit/Value/ValueTest.php index 5b34831b..b97e5f65 100644 --- a/tests/Unit/Value/ValueTest.php +++ b/tests/Unit/Value/ValueTest.php @@ -64,6 +64,7 @@ public function parsesArithmeticInFunctions(string $operator): void self::assertSame( [ 'class' => 'CSSFunction', + 'name' => 'max', 'components' => [ [ 'class' => 'Size', @@ -92,7 +93,6 @@ public function parsesArithmeticInFunctions(string $operator): void ], ], 'separator' => ',', - 'name' => 'max', ], $result );