Add a type to an untyped array_any()/array_all() closure param, based on the array item type
/** @var string[] $items */
-array_any($items, fn ($item): bool => $item !== '');
+array_any($items, fn (string $item): bool => $item !== '');
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\FuncCall\AddArrayAnyAllClosureParamTypeRector;
return RectorConfig::configure()
->withRules([
AddArrayAnyAllClosureParamTypeRector::class,
]);