Skip to content

Commit 55c7f40

Browse files
committed
Updated Rector to commit 2d0e0f178d7ed0b6f129063dd9d23a4ac2bd2cfb
rectorphp/rector-src@2d0e0f1 [utils] Add CheaperGuardFirstRule PHPStan rule to enforce early bail before expensive analysis (#8105)
1 parent 30788b7 commit 55c7f40

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

rules/Php73/Rector/FuncCall/StringifyStrNeedlesRector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ public function refactor(Node $node): ?Node
6161
}
6262
// is argument string?
6363
$needleArgValue = $node->args[1]->value;
64-
$needleType = $this->getType($needleArgValue);
65-
if ($needleType->isString()->yes()) {
64+
if ($needleArgValue instanceof InterpolatedString) {
6665
return null;
6766
}
68-
if ($needleArgValue instanceof InterpolatedString) {
67+
$needleType = $this->getType($needleArgValue);
68+
if ($needleType->isString()->yes()) {
6969
return null;
7070
}
7171
$node->args[1]->value = new String_($node->args[1]->value);

rules/TypeDeclaration/Rector/ClassMethod/AddReturnDocblockForScalarArrayFromAssignsRector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ public function getNodeTypes(): array
114114
*/
115115
public function refactor(Node $node): ?Node
116116
{
117+
if ($node->returnType instanceof Node && !$this->isName($node->returnType, 'array')) {
118+
return null;
119+
}
117120
$phpDocInfo = $this->phpDocInfoFactory->createFromNodeOrEmpty($node);
118121
$returnType = $phpDocInfo->getReturnType();
119122
if (!$returnType instanceof MixedType || $returnType->isExplicitMixed()) {
120123
return null;
121124
}
122-
if ($node->returnType instanceof Node && !$this->isName($node->returnType, 'array')) {
123-
return null;
124-
}
125125
$returnsScoped = $this->betterNodeFinder->findReturnsScoped($node);
126126
if (!$this->returnAnalyzer->hasOnlyReturnWithExpr($node, $returnsScoped)) {
127127
return null;

rules/TypeDeclaration/Rector/FunctionLike/AddClosureParamTypeFromIterableMethodCallRector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ public function refactor(Node $node): ?Node
9696
if ($node->isFirstClassCallable()) {
9797
return null;
9898
}
99+
if (!$node->name instanceof Identifier) {
100+
return null;
101+
}
99102
$varType = $this->getType($node->var);
100103
if (!$varType instanceof IntersectionType || !$varType->isIterable()->yes()) {
101104
return null;
@@ -104,9 +107,6 @@ public function refactor(Node $node): ?Node
104107
if ($className === null) {
105108
return null;
106109
}
107-
if (!$node->name instanceof Identifier) {
108-
return null;
109-
}
110110
$methodReflection = $this->methodReflectionResolver->resolveMethodReflection($className, $node->name->name, $node->getAttribute(AttributeKey::SCOPE));
111111
if (!$methodReflection instanceof MethodReflection) {
112112
return null;

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 = '449db3f5a29344cf9c44131fd1117e3966998f3b';
22+
public const PACKAGE_VERSION = '2d0e0f178d7ed0b6f129063dd9d23a4ac2bd2cfb';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2026-06-29 08:19:48';
27+
public const RELEASE_DATE = '2026-06-29 08:32:01';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)