16
16
use TypeLang \PHPDoc \Tag \InvalidTag ;
17
17
use TypeLang \PHPDoc \Tag \TagInterface ;
18
18
use TypeLang \PHPDoc \Standard ;
19
- use TypeLang \PHPDoc \Tag \TypeProviderInterface ;
20
19
21
20
#[Group('functional ' ), Group('type-lang/parser ' )]
22
21
abstract class LinterStubsTestCase extends TestCase
@@ -90,8 +89,6 @@ protected static function getAllTags(): iterable
90
89
\mkdir ($ directory , recursive: true );
91
90
}
92
91
93
- $ types = [];
94
-
95
92
foreach (self ::getFiles () as $ name => $ pathname ) {
96
93
$ cache = $ directory . '/ ' . \str_replace (['/ ' , '\\' ], '- ' , $ name ) . '.cache ' ;
97
94
@@ -156,13 +153,16 @@ public static function paramTagDataProvider(): iterable
156
153
#[DataProvider('paramTagDataProvider ' )]
157
154
public function testParamStatementsIsCorrectlyRecognized (TagInterface $ tag ): void
158
155
{
159
- // TODO Known phpdoc parser issue for variadic or optional variables
160
- $ this ->skipInCaseOfReasonPhraseContains ($ tag , 'contains an incorrect variable name ' );
156
+ // PHPStan SplObjectStorage docblock bug?
157
+ $ this ->skipInCaseOfReasonPhraseContains ($ tag , 'contains an incorrect variable name: '
158
+ . ' \SplObjectStorage<*, *> $storage ' );
161
159
162
- // TODO Known phpdoc parser issue for non-typed @param tags
163
- $ this ->skipInCaseOfReasonPhraseContains ($ tag , 'type: &$info [optional] ' );
164
- $ this ->skipInCaseOfReasonPhraseContains ($ tag , 'type: &$composed [optional] ' );
165
- $ this ->skipInCaseOfReasonPhraseContains ($ tag , 'type: &$result [optional] ' );
160
+ // Psalm redis docblock bug (param tag does not provide variable name)
161
+ $ this ->skipInCaseOfReasonPhraseContains ($ tag , 'contains an incorrect variable name: '
162
+ . ' array<int|string, string> ' );
163
+ // Known phpdoc bug
164
+ $ this ->skipInCaseOfReasonPhraseContains ($ tag , 'contains an incorrect variable name: '
165
+ . ' $1 $2 ' );
166
166
167
167
self ::assertInstanceOf (Standard \ParamTag::class, $ tag ,
168
168
message: self ::getReasonPhrase ($ tag ),
@@ -238,7 +238,7 @@ public function testThrowsStatementsIsCorrectlyRecognized(TagInterface $tag): vo
238
238
);
239
239
}
240
240
241
- private static function getReasonPhrase (TagInterface $ tag ): string
241
+ protected static function getReasonPhrase (TagInterface $ tag ): string
242
242
{
243
243
if ($ tag instanceof InvalidTag) {
244
244
$ reason = $ tag ->getReason ();
@@ -249,7 +249,7 @@ private static function getReasonPhrase(TagInterface $tag): string
249
249
return 'Failed to parse tag: ' . \print_r ($ tag , true );
250
250
}
251
251
252
- private static function skipInCaseOfReasonPhraseContains (TagInterface $ tag , string $ message ): void
252
+ protected static function skipInCaseOfReasonPhraseContains (TagInterface $ tag , string $ message ): void
253
253
{
254
254
if (!$ tag instanceof InvalidTag) {
255
255
return ;
0 commit comments