Remove data provider keys, that should match param names, as order is good enough
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\DataProvider;
final class SomeServiceTest extends TestCase
{
#[DataProvider('provideData')]
public function test(string $name): void
{
}
public function provideData(): array
{
return [
- 'name' => ['Tom'],
+ ['Tom'],
];
}
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\PHPUnit\CodeQuality\Rector\Class_\RemoveDataProviderParamKeysRector;
return RectorConfig::configure()
->withRules([
RemoveDataProviderParamKeysRector::class,
]);