Browse Source

chore: add tags for data providers that will change PHPStan's baseline (#8178)

Kuba Werłos 6 months ago
parent
commit
f103a6b79d

+ 6 - 6
dev-tools/phpstan/baseline.php

@@ -3049,6 +3049,12 @@ $ignoreErrors[] = [
 	'count' => 1,
 	'path' => __DIR__ . '/../../tests/Fixer/FunctionNotation/NullableTypeDeclarationForDefaultNullValueFixerTest.php',
 ];
+$ignoreErrors[] = [
+	// identifier: generator.valueType
+	'message' => '#^Generator expects value type array\\{0\\: string, 1\\?\\: string\\}, array\\{0\\?\\: string, 1\\: string\\} given\\.$#',
+	'count' => 1,
+	'path' => __DIR__ . '/../../tests/Fixer/Operator/IncrementStyleFixerTest.php',
+];
 $ignoreErrors[] = [
 	// identifier: offsetAccess.notFound
 	'message' => '#^Offset \'operators\' might not exist on array\\<string, mixed\\>\\.$#',
@@ -3091,12 +3097,6 @@ $ignoreErrors[] = [
 	'count' => 1,
 	'path' => __DIR__ . '/../../tests/Fixer/Semicolon/SemicolonAfterInstructionFixerTest.php',
 ];
-$ignoreErrors[] = [
-	// identifier: argument.type
-	'message' => '#^Parameter \\#2 \\$array of function array_map expects array, iterable given\\.$#',
-	'count' => 1,
-	'path' => __DIR__ . '/../../tests/Fixer/Whitespace/LineEndingFixerTest.php',
-];
 $ignoreErrors[] = [
 	// identifier: new.resultUnused
 	'message' => '#^Call to new PhpCsFixer\\\\FixerConfiguration\\\\AliasedFixerOption\\(\\) on a separate line has no effect\\.$#',

+ 1 - 1
phpstan.dist.neon

@@ -56,6 +56,6 @@ parameters:
         -
             message: '#^Method PhpCsFixer\\Tests\\.+::provide.+Cases\(\) return type has no value type specified in iterable type iterable\.$#'
             path: tests
-            count: 1005
+            count: 1002
     tipsOfTheDay: false
     tmpDir: dev-tools/phpstan/cache

+ 6 - 0
tests/Fixer/Operator/IncrementStyleFixerTest.php

@@ -50,6 +50,9 @@ final class IncrementStyleFixerTest extends AbstractFixerTestCase
         $this->doTest($expected, $input);
     }
 
+    /**
+     * @return iterable<array{0: string, 1?: string}>
+     */
     public static function provideFixPostIncrementCases(): iterable
     {
         foreach (self::provideFixPreIncrementCases() as $case) {
@@ -57,6 +60,9 @@ final class IncrementStyleFixerTest extends AbstractFixerTestCase
         }
     }
 
+    /**
+     * @return iterable<array{0: string, 1?: string}>
+     */
     public static function provideFixPreIncrementCases(): iterable
     {
         yield [

+ 4 - 1
tests/Fixer/Whitespace/LineEndingFixerTest.php

@@ -99,7 +99,10 @@ final class LineEndingFixerTest extends AbstractFixerTestCase
         ];
     }
 
-    private static function provideCommonCases(): iterable
+    /**
+     * @return array<int|string, array{string, string}>
+     */
+    private static function provideCommonCases(): array
     {
         return [
             'T_OPEN_TAG' => [