Change explicit configuration parameter pass into #[Autowire] attributes
+use Symfony\Component\DependencyInjection\Attribute\Autowire;
+
final class SomeClass
{
public function __construct(
+ #[Autowire(param: 'timeout')]
private int $timeout,
+ #[Autowire(env: 'APP_SECRET')]
private string $secret,
) {
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Symfony\Configs\Rector\Class_\AutowireAttributeRector;
return RectorConfig::configure()
->withConfiguredRule(AutowireAttributeRector::class, [
'configs_directory' => __DIR__ . '/config',
]);