Skip to content

Commit 9eed7bc

Browse files
committed
[ci-review] Rector Rectify
1 parent b1d9aa3 commit 9eed7bc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

rules/Php70/NodeAnalyzer/MethodCallNameAnalyzer.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
namespace Rector\Php70\NodeAnalyzer;
66

7+
use PhpParser\Node\Expr\Variable;
8+
use PhpParser\Node\Stmt\ClassMethod;
79
use PhpParser\Node\Expr;
810
use PhpParser\Node\Expr\MethodCall;
911
use PhpParser\Node\Identifier;
@@ -18,7 +20,7 @@ public function isLocalMethodCallNamed(Expr $expr, string $desiredMethodName): b
1820
return false;
1921
}
2022

21-
if (! $expr->var instanceof Expr\Variable) {
23+
if (! $expr->var instanceof Variable) {
2224
return false;
2325
}
2426

@@ -40,7 +42,7 @@ public function isParentMethodCall(Class_ $class, Expr $expr): bool
4042
}
4143

4244
$parentClassName = $class->extends->toString();
43-
if ($class->getMethod($parentClassName)) {
45+
if ($class->getMethod($parentClassName) instanceof ClassMethod) {
4446
return false;
4547
}
4648

rules/Php70/Rector/ClassMethod/Php4ConstructorRector.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Rector\Php70\Rector\ClassMethod;
66

7+
use PhpParser\Node\Name\FullyQualified;
78
use PhpParser\Node;
89
use PhpParser\Node\Expr\MethodCall;
910
use PhpParser\Node\Expr\StaticCall;
@@ -140,7 +141,7 @@ public function refactor(Node $node): Class_|null
140141
/** @var string $parentClassName */
141142
$parentClassName = $node->extends->toString();
142143

143-
$classMethodStmt->expr = new StaticCall(new Name\FullyQualified($parentClassName), new Identifier(
144+
$classMethodStmt->expr = new StaticCall(new FullyQualified($parentClassName), new Identifier(
144145
MethodName::CONSTRUCT
145146
), $expr->args);
146147
}

0 commit comments

Comments
 (0)