diff --git a/tests/Rules/NarrowPublicClassMethodParamTypeRule/Fixture/Generics/SkipPassedGenerics.php b/tests/Rules/NarrowPublicClassMethodParamTypeRule/Fixture/Generics/SkipPassedGenerics.php new file mode 100644 index 00000000..309ba5c5 --- /dev/null +++ b/tests/Rules/NarrowPublicClassMethodParamTypeRule/Fixture/Generics/SkipPassedGenerics.php @@ -0,0 +1,24 @@ + $g */ + public function doFoo(GenericA $g):void + { + } +} + +/** @param GenericA $g */ +function doFoo($g):void { + $user = new User(); + $user->doFoo($g); +} diff --git a/tests/Rules/NarrowPublicClassMethodParamTypeRule/NarrowPublicClassMethodParamTypeRuleTest.php b/tests/Rules/NarrowPublicClassMethodParamTypeRule/NarrowPublicClassMethodParamTypeRuleTest.php index 37709674..cbe2aab1 100644 --- a/tests/Rules/NarrowPublicClassMethodParamTypeRule/NarrowPublicClassMethodParamTypeRuleTest.php +++ b/tests/Rules/NarrowPublicClassMethodParamTypeRule/NarrowPublicClassMethodParamTypeRuleTest.php @@ -26,6 +26,8 @@ public function testRule(array $filePaths, array $expectedErrorsWithLines): void public static function provideData(): Iterator { + yield [[__DIR__ . '/Fixture/Generics/SkipPassedGenerics.php'], []]; + yield [[__DIR__ . '/Fixture/SkipDefault.php'], []]; yield [[__DIR__ . '/Fixture/SkipResource.php'], []]; yield [[__DIR__ . '/Fixture/SkipDateTimeMix.php'], []];