Here's rector.yaml and the command :
docker run --rm -v $(pwd):/app rector_phar process --ansi --autoload-file /app/vendor/autoload.php --config /app/rector.yaml /app/src --dry-run
Rector 0.6.x-dev@9a330e2
Config file: app/rector.yaml
111/111 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
1 file with changes
===================
1) src/Functional/Functional.php
---------- begin diff ----------
--- Original
+++ New
@@ -101,11 +101,7 @@
*/
function eachSpread(array $array, callable $fn): array
{
- return each($array, static function (array $chunk, $key) use ($fn) {
- $chunk[] = $key;
-
- return $fn(...$chunk);
- });
+ return each($array);
}
function every(array $array, callable $fn): bool
----------- end diff -----------
Applied rules:
* Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector
* Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector
* Rector\Php54\Rector\FuncCall\RemoveReferenceFromCallRector
* Rector\MysqlToMysqli\Rector\FuncCall\MysqlFuncCallToMysqliRector
* Rector\Rector\Argument\SwapFuncCallArgumentsRector
* Rector\Php70\Rector\FuncCall\RandomFunctionRector
Here's the (simplified) file :
<?php
function each(array $array, callable $fn): array
{
foreach ($array as $key => $value) {
if ($fn($value, $key) === false) {
break;
}
}
return $array;
}
function eachSpread(array $array, callable $fn): array
{
return each($array, static function (array $chunk, $key) use ($fn) {
$chunk[] = $key;
return $fn(...$chunk);
});
}
The problem disappears if I add :
function eachSpread(array $array, callable $fn): array
{
/**
* @noRector Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector
*/
return each($array, static function (array $chunk, $key) use ($fn) {
Here's rector.yaml and the command :
docker run --rm -v $(pwd):/app rector_phar process --ansi --autoload-file /app/vendor/autoload.php --config /app/rector.yaml /app/src --dry-run Rector 0.6.x-dev@9a330e2 Config file: app/rector.yaml 111/111 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% 1 file with changes =================== 1) src/Functional/Functional.php ---------- begin diff ---------- --- Original +++ New @@ -101,11 +101,7 @@ */ function eachSpread(array $array, callable $fn): array { - return each($array, static function (array $chunk, $key) use ($fn) { - $chunk[] = $key; - - return $fn(...$chunk); - }); + return each($array); } function every(array $array, callable $fn): bool ----------- end diff ----------- Applied rules: * Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector * Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector * Rector\Php54\Rector\FuncCall\RemoveReferenceFromCallRector * Rector\MysqlToMysqli\Rector\FuncCall\MysqlFuncCallToMysqliRector * Rector\Rector\Argument\SwapFuncCallArgumentsRector * Rector\Php70\Rector\FuncCall\RandomFunctionRectorHere's the (simplified) file :
The problem disappears if I add :