Bug Report
| Subject |
Details |
| Rector version |
last dev-main |
| Installed as |
composer dependency |
Minimal PHP Code Causing Issue
See https://getrector.com/demo/29a9e8cd-e456-4e85-a7dd-6ac069d875bd
<?php
use PHPUnit\Framework\TestCase;
final class DemoTest extends TestCase {
public function dataProvider1() {
yield [1];
yield [null];
}
public function dataProvider2() {
yield ['foo'];
}
/**
* @dataProvider dataProvider1
* @dataProvider dataProvider2
* @param int|string|null $value
*/
public function testSomething($value): void {
}
}
Responsible rules
AddParamTypeBasedOnPHPUnitDataProviderRector
Expected Behavior
Do nothing or change to int|string|null depending on PHP version. Maybe the rule only looks at the first data provider.
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/29a9e8cd-e456-4e85-a7dd-6ac069d875bd
Responsible rules
AddParamTypeBasedOnPHPUnitDataProviderRectorExpected Behavior
Do nothing or change to
int|string|nulldepending on PHP version. Maybe the rule only looks at the first data provider.