Skip to content

Commit 3182d12

Browse files
committed
Fix attrGroups/attributes confusion in EnumCase builder
Found by staabm in #907. (cherry picked from commit 21a3e8c)
1 parent 1df465c commit 3182d12

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/PhpParser/Builder/EnumCase.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ public function getNode(): PhpParser\Node {
7878
return new Stmt\EnumCase(
7979
$this->name,
8080
$this->value,
81-
$this->attributes,
82-
$this->attributeGroups
81+
$this->attributeGroups,
82+
$this->attributes
8383
);
8484
}
8585
}

test/PhpParser/Builder/EnumCaseTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public function testDocComment() {
2727
new Stmt\EnumCase(
2828
"TEST",
2929
null,
30+
[],
3031
[
3132
'comments' => [new Comment\Doc('/** Test */')]
3233
]
@@ -50,7 +51,6 @@ public function testAddAttribute() {
5051
new Stmt\EnumCase(
5152
"ATTR_GROUP",
5253
null,
53-
[],
5454
[$attributeGroup]
5555
),
5656
$node

0 commit comments

Comments
 (0)