Applies type hints to array_map closures
-array_map(function ($value, $key): string {
+array_map(function (string $value, int $key): bool {
return $value . $key;
}, $strings);
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\FunctionLike\AddClosureParamTypeForArrayMapRector;
return RectorConfig::configure()
->withRules([
AddClosureParamTypeForArrayMapRector::class,
]);