Skip to content

Commit f797e23

Browse files
committed
Updated Rector to commit 6e185e87230fc048f60ca26e93555af1bf26492f
rectorphp/rector-src@6e185e8 [phpstan] prefer isName() from abstract class over protected service (#6875)
1 parent 7042ea5 commit f797e23

File tree

32 files changed

+45
-45
lines changed

32 files changed

+45
-45
lines changed

rules/CodeQuality/Rector/ClassConstFetch/ConvertStaticPrivateConstantToSelfRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ private function isPrivateConstant(ClassConstFetch $classConstFetch, Class_ $cla
9292
return \false;
9393
}
9494
foreach ($class->getConstants() as $classConst) {
95-
if (!$this->nodeNameResolver->isName($classConst, $constantName)) {
95+
if (!$this->isName($classConst, $constantName)) {
9696
continue;
9797
}
9898
return $classConst->isPrivate();

rules/CodeQuality/Rector/Class_/CompleteDynamicPropertiesRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private function shouldSkipClass(Class_ $class) : bool
132132
if ($this->classAnalyzer->isAnonymousClass($class)) {
133133
return \true;
134134
}
135-
$className = (string) $this->nodeNameResolver->getName($class);
135+
$className = (string) $this->getName($class);
136136
if (!$this->reflectionProvider->hasClass($className)) {
137137
return \true;
138138
}

rules/CodeQuality/Rector/Class_/InlineConstructorDefaultToPropertyRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ private function matchAssignedLocalPropertyName(Assign $assign) : ?string
111111
return null;
112112
}
113113
$propertyFetch = $assign->var;
114-
if (!$this->nodeNameResolver->isName($propertyFetch->var, 'this')) {
114+
if (!$this->isName($propertyFetch->var, 'this')) {
115115
return null;
116116
}
117-
$propertyName = $this->nodeNameResolver->getName($propertyFetch->name);
117+
$propertyName = $this->getName($propertyFetch->name);
118118
if (!\is_string($propertyName)) {
119119
return null;
120120
}

rules/CodeQuality/Rector/Identical/SimplifyArraySearchRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function refactor(Node $node) : ?Node
5353
if (!$node instanceof FuncCall) {
5454
return \false;
5555
}
56-
return $this->nodeNameResolver->isName($node, 'array_search');
56+
return $this->isName($node, 'array_search');
5757
}, fn(Node $node): bool => $node instanceof Expr && $this->valueResolver->isFalse($node));
5858
if (!$twoNodeMatch instanceof TwoNodeMatch) {
5959
return null;

rules/CodeQuality/Rector/If_/ExplicitBoolCompareRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function refactor(Node $node)
129129
}
130130
private function resolveNewConditionNode(Expr $expr, bool $isNegated) : ?BinaryOp
131131
{
132-
if ($expr instanceof FuncCall && $this->nodeNameResolver->isName($expr, 'count')) {
132+
if ($expr instanceof FuncCall && $this->isName($expr, 'count')) {
133133
return $this->resolveCount($isNegated, $expr);
134134
}
135135
if ($this->arrayTypeAnalyzer->isArrayType($expr)) {

rules/CodingStyle/Rector/Catch_/CatchExceptionNameMatchingTypeRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ private function renameVariableInStmts(Catch_ $catch, string $oldVariableName, s
142142
if (!$node instanceof Variable) {
143143
return null;
144144
}
145-
if (!$this->nodeNameResolver->isName($node, $oldVariableName)) {
145+
if (!$this->isName($node, $oldVariableName)) {
146146
return null;
147147
}
148148
$node->name = $newVariableName;
@@ -166,7 +166,7 @@ private function replaceNextUsageVariable(string $oldVariableName, string $newVa
166166
if (!$node instanceof Variable) {
167167
return null;
168168
}
169-
if (!$this->nodeNameResolver->isName($node, $oldVariableName)) {
169+
if (!$this->isName($node, $oldVariableName)) {
170170
return null;
171171
}
172172
$nonAssignedVariables[] = $node;

rules/CodingStyle/Rector/ClassMethod/NewlineBeforeNewAssignSetRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ private function shouldSkipLeftVariable($node) : bool
149149
return \false;
150150
}
151151
// local method call
152-
return $this->nodeNameResolver->isName($node->var, 'this');
152+
return $this->isName($node->var, 'this');
153153
}
154154
private function isNewVariableThanBefore(?string $currentStmtVariableName) : bool
155155
{

rules/CodingStyle/Rector/FuncCall/ArraySpreadInsteadOfArrayMergeRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private function isIteratorToArrayFuncCall(Expr $expr) : bool
172172
if (!$expr instanceof FuncCall) {
173173
return \false;
174174
}
175-
if (!$this->nodeNameResolver->isName($expr, 'iterator_to_array')) {
175+
if (!$this->isName($expr, 'iterator_to_array')) {
176176
return \false;
177177
}
178178
if ($expr->isFirstClassCallable()) {

rules/DeadCode/Rector/ClassMethod/RemoveEmptyClassMethodRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ private function shouldSkipClassMethod(Class_ $class, ClassMethod $classMethod)
150150
if ($this->controllerClassMethodManipulator->isControllerClassMethod($class, $classMethod)) {
151151
return \true;
152152
}
153-
if ($this->nodeNameResolver->isName($classMethod, MethodName::CONSTRUCT)) {
153+
if ($this->isName($classMethod, MethodName::CONSTRUCT)) {
154154
// has parent class?
155155
return $class->extends instanceof FullyQualified;
156156
}
157-
return $this->nodeNameResolver->isName($classMethod, MethodName::INVOKE);
157+
return $this->isName($classMethod, MethodName::INVOKE);
158158
}
159159
private function hasDeprecatedAnnotation(ClassMethod $classMethod) : bool
160160
{

rules/DeadCode/Rector/ClassMethod/RemoveUnusedPrivateMethodParameterRector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ private function removeCallerArgs(Class_ $class, ClassMethod $classMethod, array
127127
if ($classMethods === []) {
128128
return;
129129
}
130-
$methodName = $this->nodeNameResolver->getName($classMethod);
130+
$methodName = $this->getName($classMethod);
131131
$keysArg = \array_keys($unusedParameters);
132132
foreach ($classMethods as $classMethod) {
133133
/** @var MethodCall[] $callers */
@@ -172,10 +172,10 @@ private function resolveCallers(ClassMethod $classMethod, string $methodName) :
172172
if (!$subNode->var instanceof Variable) {
173173
return \false;
174174
}
175-
if (!$this->nodeNameResolver->isName($subNode->var, 'this')) {
175+
if (!$this->isName($subNode->var, 'this')) {
176176
return \false;
177177
}
178-
return $this->nodeNameResolver->isName($subNode->name, $methodName);
178+
return $this->isName($subNode->name, $methodName);
179179
});
180180
}
181181
private function shouldSkipClassMethod(ClassMethod $classMethod) : bool

0 commit comments

Comments
 (0)