Skip to content

Commit 8953c00

Browse files
committed
make use of doc block updater
1 parent 74058c2 commit 8953c00

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rules/DowngradePhp74/Rector/ClassMethod/DowngradeCovariantReturnTypeRector.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use PHPStan\Type\ThisType;
2020
use PHPStan\Type\Type;
2121
use Rector\BetterPhpDocParser\PhpDocManipulator\PhpDocTypeChanger;
22+
use Rector\Comments\NodeDocBlock\DocBlockUpdater;
2223
use Rector\Core\Rector\AbstractRector;
2324
use Rector\Core\Reflection\ReflectionResolver;
2425
use Rector\Core\Util\Reflection\PrivatesAccessor;
@@ -42,7 +43,8 @@ public function __construct(
4243
private readonly ReturnTagRemover $returnTagRemover,
4344
private readonly ReflectionResolver $reflectionResolver,
4445
private readonly PrivatesAccessor $privatesAccessor,
45-
private readonly UnionTypeAnalyzer $unionTypeAnalyzer
46+
private readonly UnionTypeAnalyzer $unionTypeAnalyzer,
47+
private readonly DocBlockUpdater $docBlockUpdater,
4648
) {
4749
}
4850

@@ -187,6 +189,8 @@ private function addDocBlockReturn(ClassMethod $classMethod): void
187189

188190
$this->phpDocTypeChanger->changeReturnType($classMethod, $phpDocInfo, $type);
189191
$this->returnTagRemover->removeReturnTagIfUseless($phpDocInfo, $classMethod);
192+
193+
$this->docBlockUpdater->updateRefactoredNodeWithPhpDocInfo($classMethod);
190194
}
191195

192196
/**

0 commit comments

Comments
 (0)