Add array type based on array dim fetch use
class SomeClass
{
- public function resolve($item)
+ public function resolve(array $item)
{
return $item['name'];
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\ClassMethod\StrictArrayParamDimFetchRector;
return RectorConfig::configure()
->withRules([
StrictArrayParamDimFetchRector::class,
]);