File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
rules/DowngradePhp74/Rector/ClassMethod Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1919use PHPStan \Type \ThisType ;
2020use PHPStan \Type \Type ;
2121use Rector \BetterPhpDocParser \PhpDocManipulator \PhpDocTypeChanger ;
22+ use Rector \Comments \NodeDocBlock \DocBlockUpdater ;
2223use Rector \Core \Rector \AbstractRector ;
2324use Rector \Core \Reflection \ReflectionResolver ;
2425use 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 /**
You can’t perform that action at this time.
0 commit comments