Skip to content

Commit 76ce3a5

Browse files
authored
Directly use isName(s) and getName() on rector rules (#488)
* Directly use isName(s) and getName() on rector rules * Fix ci
1 parent 462d1a9 commit 76ce3a5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
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
}

0 commit comments

Comments
 (0)