Skip to content

Commit

Permalink
[Php72][TypeDeclaration] Rollback tweak infinite loop handling on Dec…
Browse files Browse the repository at this point in the history
…lareStrictTypesRector (#5700)
  • Loading branch information
samsonasik committed Mar 8, 2024
1 parent 13bafcb commit c14f8d4
Showing 1 changed file with 2 additions and 4 deletions.
Expand Up @@ -64,13 +64,11 @@ public function beforeTraverse(array $nodes): ?array
return null;
}

// use 0 index to avoid infinite loop
$rootStmt = $newStmts[0] ?? null;
$rootStmt = current($newStmts);
$stmt = $rootStmt;

if ($rootStmt instanceof FileWithoutNamespace) {
// use 0 index to avoid infinite loop
$currentStmt = $rootStmt->stmts[0] ?? null;
$currentStmt = current($rootStmt->stmts);

if (! $currentStmt instanceof Stmt) {
return null;
Expand Down

0 comments on commit c14f8d4

Please sign in to comment.