Skip to content

Commit ed2c0d2

Browse files
committed
fix attempts
1 parent ed8e5f1 commit ed2c0d2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Analyser/MutatingScope.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,6 +3012,9 @@ private function transformStaticType(Type $type): Type
30123012
if (!$this->isInClass()) {
30133013
return $type;
30143014
}
3015+
if ($type instanceof ThisType) {
3016+
return $traverse($type);
3017+
}
30153018
if ($type instanceof StaticType) {
30163019
$classReflection = $this->getClassReflection();
30173020
$changedType = $type->changeBaseClass($classReflection);

src/Analyser/NodeScopeResolver.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6157,6 +6157,10 @@ public function getPhpDocs(Scope $scope, Node\FunctionLike|Node\Stmt\Property $n
61576157
private function transformStaticType(ClassReflection $declaringClass, Type $type): Type
61586158
{
61596159
return TypeTraverser::map($type, static function (Type $type, callable $traverse) use ($declaringClass): Type {
6160+
if ($type instanceof ThisType) {
6161+
return $traverse($type);
6162+
}
6163+
61606164
if ($type instanceof StaticType) {
61616165
$changedType = $type->changeBaseClass($declaringClass);
61626166
if ($declaringClass->isFinal()) {

0 commit comments

Comments
 (0)