Skip to content

Commit

Permalink
Fix attrGroups/attributes confusion in EnumCase builder
Browse files Browse the repository at this point in the history
Found by staabm in #907.

(cherry picked from commit 21a3e8c)
  • Loading branch information
nikic committed Dec 14, 2022
1 parent 1df465c commit 3182d12
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/PhpParser/Builder/EnumCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public function getNode(): PhpParser\Node {
return new Stmt\EnumCase(
$this->name,
$this->value,
$this->attributes,
$this->attributeGroups
$this->attributeGroups,
$this->attributes
);
}
}
2 changes: 1 addition & 1 deletion test/PhpParser/Builder/EnumCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function testDocComment() {
new Stmt\EnumCase(
"TEST",
null,
[],
[
'comments' => [new Comment\Doc('/** Test */')]
]
Expand All @@ -50,7 +51,6 @@ public function testAddAttribute() {
new Stmt\EnumCase(
"ATTR_GROUP",
null,
[],
[$attributeGroup]
),
$node
Expand Down

0 comments on commit 3182d12

Please sign in to comment.