Skip to content

Commit b510dda

Browse files
committed
ThisType - add forgotten passing of traitReflection in new self()
1 parent 79155b1 commit b510dda

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Type/ThisType.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(
2525

2626
public function changeBaseClass(ClassReflection $classReflection): StaticType
2727
{
28-
return new self($classReflection, $this->getSubtractedType());
28+
return new self($classReflection, $this->getSubtractedType(), $this->traitReflection);
2929
}
3030

3131
public function describe(VerbosityLevel $level): string
@@ -66,7 +66,7 @@ public function changeSubtractedType(?Type $subtractedType): Type
6666
{
6767
$type = parent::changeSubtractedType($subtractedType);
6868
if ($type instanceof parent) {
69-
return new self($type->getClassReflection(), $subtractedType);
69+
return new self($type->getClassReflection(), $subtractedType, $this->traitReflection);
7070
}
7171

7272
return $type;
@@ -93,6 +93,7 @@ public function traverse(callable $cb): Type
9393
return new self(
9494
$this->getClassReflection(),
9595
$subtractedType,
96+
$this->traitReflection,
9697
);
9798
}
9899

0 commit comments

Comments
 (0)