Skip to content

Commit a164561

Browse files
committed
Directly use isName(s) and getName() on rector rules
1 parent 462d1a9 commit a164561

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

rules/CodeQuality/Rector/Class_/ConstructClassMethodToSetUpTestCaseRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ private function isParentCallNamed(Node $node, string $desiredMethodName): bool
208208
return false;
209209
}
210210

211-
if (! $this->nodeNameResolver->isName($node->class, 'parent')) {
211+
if (! $this->isName($node->class, 'parent')) {
212212
return false;
213213
}
214214

215215
if ($node->name instanceof Expr) {
216216
return false;
217217
}
218218

219-
return $this->nodeNameResolver->isName($node->name, $desiredMethodName);
219+
return $this->isName($node->name, $desiredMethodName);
220220
}
221221

222222
private function shouldSkipClass(Class_ $class): bool

rules/PHPUnit100/Rector/Class_/StaticDataProviderClassMethodRector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private function skipMethod(ClassMethod $classMethod): bool
125125

126126
return (bool) $this->betterNodeFinder->findFirst(
127127
$classMethod->stmts,
128-
fn (Node $node): bool => $node instanceof Variable && $this->nodeNameResolver->isName($node, 'this')
128+
fn (Node $node): bool => $node instanceof Variable && $this->isName($node, 'this')
129129
);
130130
}
131131
}

rules/PHPUnit100/Rector/StmtsAwareInterface/ExpectsMethodCallDecorator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function decorate(Expression $expression): MethodCall|StaticCall|null
4343
return null;
4444
}
4545

46-
if (! $this->nodeNameResolver->isName($node->name, 'expects')) {
46+
if (! $this->isName($node->name, 'expects')) {
4747
return null;
4848
}
4949

0 commit comments

Comments
 (0)