Skip to content

Commit b2ed5b5

Browse files
committed
ClassType::__clone() clones traits
1 parent 93166ff commit b2ed5b5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/PhpGenerator/ClassType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ private function validateNames(array $names): void
616616
public function __clone()
617617
{
618618
$clone = fn($item) => clone $item;
619+
$this->traits = array_map($clone, $this->traits);
619620
$this->cases = array_map($clone, $this->cases);
620621
$this->consts = array_map($clone, $this->consts);
621622
$this->properties = array_map($clone, $this->properties);

0 commit comments

Comments
 (0)