Skip to content

Commit fd2182b

Browse files
committed
Updated Rector to commit 3be6fd7636ee24d82606f6166f94d8372fee800d
rectorphp/rector-src@3be6fd7 Clean up repetitive recursive call and flag on ArrayKeyFirstLastRector (#6889)
1 parent 460bcbd commit fd2182b

2 files changed

Lines changed: 5 additions & 9 deletions

File tree

rules/Php73/Rector/FuncCall/ArrayKeyFirstLastRector.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function getNodeTypes() : array
8181
*/
8282
public function refactor(Node $node) : ?StmtsAwareInterface
8383
{
84-
return $this->processArrayKeyFirstLast($node, \false);
84+
return $this->processArrayKeyFirstLast($node);
8585
}
8686
public function provideMinPhpVersion() : int
8787
{
@@ -91,7 +91,7 @@ public function providePolyfillPackage() : string
9191
{
9292
return PolyfillPackage::PHP_73;
9393
}
94-
private function processArrayKeyFirstLast(StmtsAwareInterface $stmtsAware, bool $hasChanged, int $jumpToKey = 0) : ?StmtsAwareInterface
94+
private function processArrayKeyFirstLast(StmtsAwareInterface $stmtsAware, int $jumpToKey = 0) : ?StmtsAwareInterface
9595
{
9696
if ($stmtsAware->stmts === null) {
9797
return null;
@@ -124,10 +124,6 @@ private function processArrayKeyFirstLast(StmtsAwareInterface $stmtsAware, bool
124124
$keyFuncCall->name = new Name($newName);
125125
$this->changeNextKeyCall($stmtsAware, $key + 2, $resetOrEndFuncCall, $keyFuncCall->name);
126126
unset($stmtsAware->stmts[$key]);
127-
$hasChanged = \true;
128-
return $this->processArrayKeyFirstLast($stmtsAware, $hasChanged, $key + 2);
129-
}
130-
if ($hasChanged) {
131127
return $stmtsAware;
132128
}
133129
return null;
@@ -140,7 +136,7 @@ private function changeNextKeyCall(StmtsAwareInterface $stmtsAware, int $key, Fu
140136
break;
141137
}
142138
if ($stmtsAware->stmts[$nextKey] instanceof Expression && !$this->shouldSkip($stmtsAware->stmts[$nextKey])) {
143-
$this->processArrayKeyFirstLast($stmtsAware, \true, $nextKey);
139+
$this->processArrayKeyFirstLast($stmtsAware, $nextKey);
144140
break;
145141
}
146142
$keyFuncCall = $this->resolveKeyFuncCall($stmtsAware->stmts[$nextKey], $resetOrEndFuncCall);

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 = 'ddb43f6c44b0d8fbb96bc5e5d9458d39ac8a9e25';
22+
public const PACKAGE_VERSION = '3be6fd7636ee24d82606f6166f94d8372fee800d';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-05-09 04:45:11';
27+
public const RELEASE_DATE = '2025-05-08 22:18:12';
2828
/**
2929
* @var int
3030
*/

0 commit comments

Comments
 (0)