Configurable

AddClosureParamTypeFromArgRector

Add closure param type based on known passed service/string types of method calls

 $app = new Container();
-$app->extend(SomeClass::class, function ($parameter) {});
+$app->extend(SomeClass::class, function (SomeClass $parameter) {});

Configure your rector.php:

<?php

use Rector\Config\RectorConfig;
use Rector\TypeDeclaration\Rector\FunctionLike\AddClosureParamTypeFromArgRector;
use Rector\TypeDeclaration\ValueObject\AddClosureParamTypeFromArg;

return RectorConfig::configure()
    ->withConfiguredRule(AddClosureParamTypeFromArgRector::class, [
        new AddClosureParamTypeFromArg('Container', 'extend', 1, 0),
    ]);