Skip to content

Commit 4108f14

Browse files
committed
Multiple traits are not unpacked from node - Close #23
1 parent 6232878 commit 4108f14

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/Builder/ClassBuilder.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -364,13 +364,16 @@ static function (Node\Name $name) {
364364
);
365365
break;
366366
case $node instanceof Node\Stmt\TraitUse:
367-
$this->traits = \array_map(
368-
static function (Node\Name $name) {
369-
return $name instanceof Node\Name\FullyQualified
370-
? '\\' . $name->toString()
371-
: $name->toString();
372-
},
373-
$node->traits
367+
\array_push(
368+
$this->traits,
369+
...\array_map(
370+
static function (Node\Name $name) {
371+
return $name instanceof Node\Name\FullyQualified
372+
? '\\' . $name->toString()
373+
: $name->toString();
374+
},
375+
$node->traits
376+
)
374377
);
375378
break;
376379
case $node instanceof Node\Stmt\ClassConst:

0 commit comments

Comments
 (0)