Browse Source

chore: list over array in more places (#7857)

Dariusz Rumiński 1 year ago
parent
commit
64c4398977

+ 1 - 1
src/Console/Report/FixReport/GitlabReporter.php

@@ -73,7 +73,7 @@ final class GitlabReporter implements ReporterInterface
     }
 
     /**
-     * @param array<Diff> $diffs
+     * @param list<Diff> $diffs
      *
      * @return array{begin: int, end: int}
      */

+ 1 - 1
src/Fixer/Phpdoc/PhpdocParamOrderFixer.php

@@ -229,7 +229,7 @@ function m($a, array $b, Foo $c) {}
      *
      * @param Annotation[] $paramAnnotations
      *
-     * @return null|array<int>
+     * @return ?list<int>
      */
     private function findParamAnnotationByIdentifier(array $paramAnnotations, string $identifier): ?array
     {

+ 1 - 1
tests/Fixer/Basic/NoTrailingCommaInSinglelineFixerTest.php

@@ -35,7 +35,7 @@ final class NoTrailingCommaInSinglelineFixerTest extends AbstractFixerTestCase
     }
 
     /**
-     * @return iterable<array{string, null|string, 2?: array{elements?: array<string>}}>
+     * @return iterable<array{string, null|string, 2?: array{elements?: list<string>}}>
      */
     public static function provideFixCases(): iterable
     {

+ 1 - 1
tests/Fixer/ClassNotation/ClassAttributesSeparationFixerTest.php

@@ -2203,7 +2203,7 @@ enum Cards: string
     }
 
     /**
-     * @param array<mixed> $elements
+     * @param array<array-key, mixed> $elements
      *
      * @dataProvider provideInvalidConfigurationCases
      */

+ 2 - 2
tests/Fixer/ControlStructure/NoUselessElseFixerTest.php

@@ -1018,9 +1018,9 @@ else?><?php echo 5;',
     }
 
     /**
-     * @return array<array<string>>
+     * @return iterable<array{0: string, 1?: string}>
      */
-    private static function generateCases(string $expected, ?string $input = null): array
+    private static function generateCases(string $expected, ?string $input = null): iterable
     {
         $cases = [];
 

+ 1 - 1
tests/Fixer/PhpUnit/PhpUnitDataProviderReturnTypeFixerTest.php

@@ -217,7 +217,7 @@ class FooTest extends TestCase {
     }
 
     /**
-     * @return array<string>
+     * @return list<string>
      */
     private static function mapToTemplate(string ...$types): array
     {

+ 1 - 1
tests/Fixer/Phpdoc/GeneralPhpdocTagRenameFixerTest.php

@@ -265,7 +265,7 @@ final class GeneralPhpdocTagRenameFixerTest extends AbstractFixerTestCase
     }
 
     /**
-     * @param array<mixed> $replacements
+     * @param array<array-key, mixed> $replacements
      *
      * @dataProvider provideConfigureWithInvalidReplacementsCases
      */

+ 1 - 1
tests/Fixer/Phpdoc/PhpdocAlignFixerTest.php

@@ -29,7 +29,7 @@ final class PhpdocAlignFixerTest extends AbstractFixerTestCase
     /**
      * @dataProvider provideFixCases
      *
-     * @param array{align: string, tags: array<string>, spacing: array<string,int>} $configuration
+     * @param array{align: string, tags: list<string>, spacing: array<string,int>} $configuration
      */
     public function testFix(
         array $configuration,

+ 4 - 4
tests/Fixer/Whitespace/NoSpacesAroundOffsetFixerTest.php

@@ -293,7 +293,7 @@ $var = $arr[0][     0
     }
 
     /**
-     * @return iterable<array{string, string, array{positions: array<string>}}>
+     * @return iterable<array{string, string, array{positions: list<string>}}>
      */
     public static function provideFixWithConfigurationCases(): iterable
     {
@@ -358,7 +358,7 @@ $var = $arr[0]{     0
     }
 
     /**
-     * @param array{positions: array<string>} $configuration
+     * @param array{positions: list<string>} $configuration
      *
      * @dataProvider provideFix80Cases
      *
@@ -371,7 +371,7 @@ $var = $arr[0]{     0
     }
 
     /**
-     * @return iterable<array{string, string, array{positions: array<string>}}>
+     * @return iterable<array{string, string, array{positions: list<string>}}>
      */
     public static function provideFix80Cases(): iterable
     {
@@ -394,7 +394,7 @@ $var = $arr[0]{     0
     }
 
     /**
-     * @return iterable<array{string, string, array{positions: array<string>}}>
+     * @return iterable<array{string, string, array{positions: list<string>}}>
      */
     private static function provideMultiDimensionalArrayCases(): iterable
     {

+ 1 - 1
tests/Indicator/PhpUnitTestCaseIndicatorTest.php

@@ -151,7 +151,7 @@ class Foo extends A implements TestInterface, SomethingElse
     }
 
     /**
-     * @param array<array{0: int, 1: int}> $expectedIndexes
+     * @param list<array{0: int, 1: int}> $expectedIndexes
      *
      * @dataProvider provideFindPhpUnitClassesCases
      */

Some files were not shown because too many files changed in this diff