Skip to content

Commit

Permalink
[Php70] Remove $scope->isInClass on Php4ConstructorRector (#4507)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jul 13, 2023
1 parent 8537bbd commit d64a761
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions rules/Php70/Rector/ClassMethod/Php4ConstructorRector.php
Expand Up @@ -89,10 +89,6 @@ public function refactorWithScope(Node $node, Scope $scope): Class_|int|null
return null;
}

if (! $scope->isInClass()) {
return null;
}

$psr4ConstructorMethod = $node->getMethod(lcfirst($className)) ?? $node->getMethod($className);
if (! $psr4ConstructorMethod instanceof ClassMethod) {
return null;
Expand All @@ -103,6 +99,9 @@ public function refactorWithScope(Node $node, Scope $scope): Class_|int|null
}

$classReflection = $scope->getClassReflection();
if (! $classReflection instanceof ClassReflection) {
return null;
}

// process parent call references first
$this->processClassMethodStatementsForParentConstructorCalls($psr4ConstructorMethod, $scope);
Expand Down

0 comments on commit d64a761

Please sign in to comment.