Fix attrGroups/attributes confusion in EnumCase builder

Found by staabm in #907.
This commit is contained in:
Nikita Popov 2022-12-14 21:50:11 +01:00
parent 950bf8f1d1
commit 21a3e8cac5
2 changed files with 3 additions and 3 deletions

View File

@ -80,8 +80,8 @@ class EnumCase implements PhpParser\Builder {
return new Stmt\EnumCase( return new Stmt\EnumCase(
$this->name, $this->name,
$this->value, $this->value,
$this->attributes, $this->attributeGroups,
$this->attributeGroups $this->attributes
); );
} }
} }

View File

@ -26,6 +26,7 @@ class EnumCaseTest extends \PHPUnit\Framework\TestCase {
new Stmt\EnumCase( new Stmt\EnumCase(
"TEST", "TEST",
null, null,
[],
[ [
'comments' => [new Comment\Doc('/** Test */')] 'comments' => [new Comment\Doc('/** Test */')]
] ]
@ -49,7 +50,6 @@ class EnumCaseTest extends \PHPUnit\Framework\TestCase {
new Stmt\EnumCase( new Stmt\EnumCase(
"ATTR_GROUP", "ATTR_GROUP",
null, null,
[],
[$attributeGroup] [$attributeGroup]
), ),
$node $node