Add param array docblock based on callable native function call
+/**
+ * @param stdClass[] $items
+ */
function process(array $items): void
{
array_walk($items, function (stdClass $item) {
echo $item->value;
});
}
Configure your rector.php:
<?php
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamArrayDocblockBasedOnCallableNativeFuncCallRector;
return RectorConfig::configure()
->withRules([
AddParamArrayDocblockBasedOnCallableNativeFuncCallRector::class,
]);