Skip to content

Commit 3ef4883

Browse files
committed
Fix transforming @param-closure-this when inherited from stubs for native functions
1 parent 90ce507 commit 3ef4883

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/PhpDoc/ResolvedPhpDocBlock.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,12 @@ public function changeParameterNamesByMapping(array $parameterNameMapping): self
300300
continue;
301301
}
302302
$transformedType = TypeTraverser::map($paramTag->getType(), $mapParameterCb);
303-
$newParamTags[$parameterNameMapping[$key]] = $paramTag->withType($transformedType);
303+
$paramTag = $paramTag->withType($transformedType);
304+
if ($paramTag->getClosureThisType() !== null) {
305+
$transformedClosureThisType = TypeTraverser::map($paramTag->getClosureThisType(), $mapParameterCb);
306+
$paramTag = $paramTag->withClosureThisType($transformedClosureThisType);
307+
}
308+
$newParamTags[$parameterNameMapping[$key]] = $paramTag;
304309
}
305310

306311
$paramOutTags = $this->getParamOutTags();

0 commit comments

Comments
 (0)