From 64a665b1f49ee700ac54d67f3a13c6037840ccc6 Mon Sep 17 00:00:00 2001 From: Jake Hotson Date: Sun, 4 Jan 2026 23:58:58 +0000 Subject: [PATCH] [TASK] Order `CSSFunction` array representation logically --- src/Value/CSSFunction.php | 12 +++++++----- tests/Unit/Value/ValueTest.php | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) 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 );