Skip to content

Commit 8a78460

Browse files
authored
[tests] Add test case for #59 (#63)
1 parent 72ef5ca commit 8a78460

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace Rector\TypePerfect\Tests\Rules\NarrowPublicClassMethodParamTypeRule\Fixture\Generics;
4+
5+
/**
6+
* @template T
7+
*/
8+
class GenericA
9+
{
10+
}
11+
12+
class User
13+
{
14+
/** @param GenericA<string> $g */
15+
public function doFoo(GenericA $g):void
16+
{
17+
}
18+
}
19+
20+
/** @param GenericA<string> $g */
21+
function doFoo($g):void {
22+
$user = new User();
23+
$user->doFoo($g);
24+
}

tests/Rules/NarrowPublicClassMethodParamTypeRule/NarrowPublicClassMethodParamTypeRuleTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ public function testRule(array $filePaths, array $expectedErrorsWithLines): void
2626

2727
public static function provideData(): Iterator
2828
{
29+
yield [[__DIR__ . '/Fixture/Generics/SkipPassedGenerics.php'], []];
30+
2931
yield [[__DIR__ . '/Fixture/SkipDefault.php'], []];
3032
yield [[__DIR__ . '/Fixture/SkipResource.php'], []];
3133
yield [[__DIR__ . '/Fixture/SkipDateTimeMix.php'], []];

0 commit comments

Comments
 (0)