File tree Expand file tree Collapse file tree
rules-tests/TypeDeclarationDocblocks/Rector/ClassMethod/AddParamArrayDocblockFromDataProviderRector/Fixture
rules/TypeDeclarationDocblocks/Rector/ClassMethod Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Rector \Tests \TypeDeclarationDocblocks \Rector \ClassMethod \AddParamArrayDocblockFromDataProviderRector \Fixture ;
6+
7+ use PHPUnit \Framework \Attributes \DataProvider ;
8+ use PHPUnit \Framework \TestCase ;
9+
10+ final class SkipMixed extends TestCase
11+ {
12+ #[DataProvider('provideData ' )]
13+ public function test (array $ names ): void
14+ {
15+ }
16+
17+ public static function provideData ($ item , $ item2 )
18+ {
19+ yield [[$ item , $ item2 ]];
20+ yield [[$ item , $ item2 ]];
21+ }
22+ }
Original file line number Diff line number Diff line change 77use PhpParser \Node ;
88use PhpParser \Node \Stmt \Class_ ;
99use PHPStan \PhpDocParser \Ast \PhpDoc \ParamTagValueNode ;
10+ use PHPStan \Type \ArrayType ;
11+ use PHPStan \Type \MixedType ;
1012use Rector \BetterPhpDocParser \PhpDocInfo \PhpDocInfoFactory ;
1113use Rector \Comments \NodeDocBlock \DocBlockUpdater ;
1214use Rector \PHPUnit \NodeAnalyzer \TestsNodeAnalyzer ;
@@ -144,6 +146,11 @@ public function refactor(Node $node): ?Node
144146 $ dataProviderNodes ->getClassMethods ()
145147 );
146148
149+ // skip mixed type, as it is not informative
150+ if ($ parameterType instanceof ArrayType && $ parameterType ->getItemType () instanceof MixedType) {
151+ continue ;
152+ }
153+
147154 $ generalizedParameterType = $ this ->typeNormalizer ->generalizeConstantTypes ($ parameterType );
148155
149156 $ parameterTypeNode = $ this ->staticTypeMapper ->mapPHPStanTypeToPHPStanPhpDocTypeNode (
You can’t perform that action at this time.
0 commit comments