Skip to content

Commit 7d0ff97

Browse files
committed
Updated Rector to commit e91db1f63c41939549489a95ff2a1a46cb107e30
rectorphp/rector-src@e91db1f add static all support to AddReturnDocblockFromMethodCallDocblockRector (#7798)
1 parent cc0da6b commit 7d0ff97

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

rules/TypeDeclarationDocblocks/Rector/ClassMethod/AddReturnDocblockFromMethodCallDocblockRector.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
use PhpParser\Node;
77
use PhpParser\Node\Expr\MethodCall;
8+
use PhpParser\Node\Expr\StaticCall;
89
use PhpParser\Node\Identifier;
910
use PhpParser\Node\Stmt\ClassMethod;
1011
use PhpParser\Node\Stmt\Return_;
@@ -121,12 +122,12 @@ public function refactor(Node $node): ?Node
121122
return null;
122123
}
123124
$onlyReturnWithExpr = $this->returnNodeFinder->findOnlyReturnWithExpr($node);
124-
if (!$onlyReturnWithExpr instanceof Return_ || !$onlyReturnWithExpr->expr instanceof MethodCall) {
125+
if (!$onlyReturnWithExpr instanceof Return_ || !$onlyReturnWithExpr->expr instanceof MethodCall && !$onlyReturnWithExpr->expr instanceof StaticCall) {
125126
return null;
126127
}
127128
$returnedMethodCall = $onlyReturnWithExpr->expr;
128129
// skip doctrine connection calls, as to generic and not helpful
129-
$callerType = $this->getType($returnedMethodCall->var);
130+
$callerType = $this->getType($returnedMethodCall instanceof MethodCall ? $returnedMethodCall->var : $returnedMethodCall->class);
130131
if ($callerType instanceof ObjectType && $callerType->isInstanceOf(DoctrineClass::CONNECTION)->yes()) {
131132
return null;
132133
}

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = 'b304146b99ab28182e34fe1204a635436549b2a0';
22+
public const PACKAGE_VERSION = 'e91db1f63c41939549489a95ff2a1a46cb107e30';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2026-01-02 22:33:17';
27+
public const RELEASE_DATE = '2026-01-03 00:21:05';
2828
/**
2929
* @var int
3030
*/

src/Config/Level/TypeDeclarationDocblocksLevel.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Rector\TypeDeclarationDocblocks\Rector\ClassMethod\AddReturnDocblockForCommonObjectDenominatorRector;
2121
use Rector\TypeDeclarationDocblocks\Rector\ClassMethod\AddReturnDocblockForDimFetchArrayFromAssignsRector;
2222
use Rector\TypeDeclarationDocblocks\Rector\ClassMethod\AddReturnDocblockForJsonArrayRector;
23-
use Rector\TypeDeclarationDocblocks\Rector\ClassMethod\AddReturnDocblockFromMethodCallDocblockRector;
2423
use Rector\TypeDeclarationDocblocks\Rector\ClassMethod\DocblockGetterReturnArrayFromPropertyDocblockVarRector;
2524
use Rector\TypeDeclarationDocblocks\Rector\ClassMethod\DocblockReturnArrayFromDirectArrayInstanceRector;
2625
final class TypeDeclarationDocblocksLevel

0 commit comments

Comments
 (0)