File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
rules/TypeDeclarationDocblocks/Rector/ClassMethod Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 55
66use PhpParser \Node ;
77use PhpParser \Node \Expr \MethodCall ;
8+ use PhpParser \Node \Expr \StaticCall ;
89use PhpParser \Node \Identifier ;
910use PhpParser \Node \Stmt \ClassMethod ;
1011use 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 }
Original file line number Diff line number Diff 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 */
Original file line number Diff line number Diff line change 2020use Rector \TypeDeclarationDocblocks \Rector \ClassMethod \AddReturnDocblockForCommonObjectDenominatorRector ;
2121use Rector \TypeDeclarationDocblocks \Rector \ClassMethod \AddReturnDocblockForDimFetchArrayFromAssignsRector ;
2222use Rector \TypeDeclarationDocblocks \Rector \ClassMethod \AddReturnDocblockForJsonArrayRector ;
23- use Rector \TypeDeclarationDocblocks \Rector \ClassMethod \AddReturnDocblockFromMethodCallDocblockRector ;
2423use Rector \TypeDeclarationDocblocks \Rector \ClassMethod \DocblockGetterReturnArrayFromPropertyDocblockVarRector ;
2524use Rector \TypeDeclarationDocblocks \Rector \ClassMethod \DocblockReturnArrayFromDirectArrayInstanceRector ;
2625final class TypeDeclarationDocblocksLevel
You can’t perform that action at this time.
0 commit comments