Skip to content

Commit 870a709

Browse files
authored
[TASK] Order CSSFunction array representation logically (#1461)
1 parent 99217b8 commit 870a709

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/Value/CSSFunction.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,12 @@ public function render(OutputFormat $outputFormat): string
121121
*/
122122
public function getArrayRepresentation(): array
123123
{
124-
$result = parent::getArrayRepresentation();
125-
126-
$result['name'] = $this->name;
127-
128-
return $result;
124+
return \array_merge(
125+
[
126+
'class' => 'placeholder',
127+
'name' => $this->name,
128+
],
129+
parent::getArrayRepresentation()
130+
);
129131
}
130132
}

tests/Unit/Value/ValueTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public function parsesArithmeticInFunctions(string $operator): void
6464
self::assertSame(
6565
[
6666
'class' => 'CSSFunction',
67+
'name' => 'max',
6768
'components' => [
6869
[
6970
'class' => 'Size',
@@ -92,7 +93,6 @@ public function parsesArithmeticInFunctions(string $operator): void
9293
],
9394
],
9495
'separator' => ',',
95-
'name' => 'max',
9696
],
9797
$result
9898
);

0 commit comments

Comments
 (0)