Skip to content

Commit b121808

Browse files
authored
[TypeDeclarationDocblocks] Use FQCN return docblock for array of object types on AddReturnDocblockFromMethodCallDocblockRector (#7802)
* [TypeDeclarationDocblocks] Use FQCN return docblock for array of object types on AddReturnDocblockFromMethodCallDocblockRector * Fix
1 parent e91db1f commit b121808

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

rules-tests/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockFromMethodCallDocblockRector/Fixture/handle_static_call.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use Rector\Tests\TypeDeclarationDocblocks\Rector\ClassMethod\AddReturnDocblockFr
2727
final class HandleStaticCall
2828
{
2929
/**
30-
* @return SomeEntity[]
30+
* @return \Rector\Tests\TypeDeclarationDocblocks\Rector\ClassMethod\AddReturnDocblockFromMethodCallDocblockRector\Source\SomeEntity[]
3131
*/
3232
public function getAll(): array
3333
{

rules-tests/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockFromMethodCallDocblockRector/Fixture/some_class.php.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ final class SomeClass
4141
}
4242

4343
/**
44-
* @return SomeEntity[]
44+
* @return \Rector\Tests\TypeDeclarationDocblocks\Rector\ClassMethod\AddReturnDocblockFromMethodCallDocblockRector\Source\SomeEntity[]
4545
*/
4646
public function getAll(): array
4747
{

rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockFromMethodCallDocblockRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function refactor(Node $node): ?Node
155155
return null;
156156
}
157157

158-
$this->phpDocTypeChanger->changeReturnTypeNode($node, $phpDocInfo, $calledReturnTagValue->type);
158+
$this->phpDocTypeChanger->changeReturnType($node, $phpDocInfo, $calledClassMethodPhpDocInfo->getReturnType());
159159

160160
return $node;
161161
}

0 commit comments

Comments
 (0)