Skip to content

Commit

Permalink
added TypeKind::KIND_RETURN
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and clxmstaab committed Jun 28, 2021
1 parent 68810b7 commit 8556693
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use PHPStan\Type\Type;
use Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfo;
use Rector\NodeTypeResolver\TypeComparator\TypeComparator;
use Rector\PHPStanStaticTypeMapper\ValueObject\TypeKind;
use Rector\StaticTypeMapper\StaticTypeMapper;
use Rector\TypeDeclaration\PhpDocParser\ParamPhpDocNodeFactory;

Expand Down Expand Up @@ -69,7 +70,7 @@ public function changeReturnType(PhpDocInfo $phpDocInfo, Type $newType): void
}

// override existing type
$newPHPStanPhpDocType = $this->staticTypeMapper->mapPHPStanTypeToPHPStanPhpDocTypeNode($newType);
$newPHPStanPhpDocType = $this->staticTypeMapper->mapPHPStanTypeToPHPStanPhpDocTypeNode($newType, TypeKind::KIND_RETURN);
$currentReturnTagValueNode = $phpDocInfo->getReturnTagValue();

if ($currentReturnTagValueNode !== null) {
Expand Down

0 comments on commit 8556693

Please sign in to comment.