You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like a Rector to add the correct return type docblock to a PHPUnit data provider method, based on the signature of the test method that references the data provider.
Rector would look for methods with the #[DataProvicder] attribute, it could then annotate the referenced data provider method, if it isn't already annotated, with relevant docblock,
Feature Request
I would like a Rector to add the correct return type docblock to a PHPUnit data provider method, based on the signature of the test method that references the data provider.
Rector would look for methods with the
#[DataProvicder]
attribute, it could then annotate the referenced data provider method, if it isn't already annotated, with relevant docblock,E.g Before
Rector can work out from the testAdd parameters that the data provider should be:
/** @return array<array-key,array<int,int,int>> */
Diff
final class NumericDataSetsTest extends TestCase { + /** @return array<array-key,array<int,int,int>> */ public static function additionProvider(): array { return [ [0, 0, 0], [0, 1, 1], [1, 0, 1], [1, 1, 3], ]; } #[DataProvider('additionProvider')] public function testAdd(int $a, int $b, int $expected): void { $this->assertSame($expected, $a + $b); } }
The text was updated successfully, but these errors were encountered: