Skip to content

Commit 2e30301

Browse files
committed
Updated Rector to commit 13bafcba1524782c349fe6523ce9c18d0f765452
rectorphp/rector-src@13bafcb [Php72][TypeDeclaration] Fix infinite loop on ParseStrWithResultArgumentRector+DeclareStrictTypesRector (#5699)
1 parent a9ac2b2 commit 2e30301

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

rules/TypeDeclaration/Rector/StmtsAwareInterface/DeclareStrictTypesRector.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,21 @@ public function beforeTraverse(array $nodes) : ?array
5252
if ($newStmts === []) {
5353
return null;
5454
}
55-
$rootStmt = \current($newStmts);
55+
// use 0 index to avoid infinite loop
56+
$rootStmt = $newStmts[0] ?? null;
5657
$stmt = $rootStmt;
5758
if ($rootStmt instanceof FileWithoutNamespace) {
58-
$currentStmt = \current($rootStmt->stmts);
59+
// use 0 index to avoid infinite loop
60+
$currentStmt = $rootStmt->stmts[0] ?? null;
5961
if (!$currentStmt instanceof Stmt) {
6062
return null;
6163
}
6264
$nodes = $rootStmt->stmts;
6365
$stmt = $currentStmt;
6466
}
67+
if (!$stmt instanceof Stmt) {
68+
return null;
69+
}
6570
if ($this->shouldSkip($stmt)) {
6671
return null;
6772
}

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = '62254600d1d3f036ae3e9c502613c4ac96a8b71b';
22+
public const PACKAGE_VERSION = '13bafcba1524782c349fe6523ce9c18d0f765452';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2024-03-07 23:31:56';
27+
public const RELEASE_DATE = '2024-03-08 04:07:33';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)