Просмотр исходного кода

DX: cleanup test (#6410)

DX: cleanup test
SpacePossum 2 лет назад
Родитель
Сommit
c17e8422ec

+ 1 - 1
src/Tokenizer/Analyzer/AlternativeSyntaxAnalyzer.php

@@ -105,7 +105,7 @@ final class AlternativeSyntaxAnalyzer
         }
     }
 
-    private function isStartOfAlternativeSyntaxBlock(Tokens $tokens, $index)
+    private function isStartOfAlternativeSyntaxBlock(Tokens $tokens, $index): bool
     {
         $map = self::ALTERNATIVE_SYNTAX_BLOCK_EDGES;
         $startTokenKind = $tokens[$index]->getId();

+ 1 - 1
tests/AutoReview/DescribeCommandTest.php

@@ -48,7 +48,7 @@ final class DescribeCommandTest extends TestCase
         static::assertSame(0, $commandTester->getStatusCode());
     }
 
-    public function provideDescribeCommandCases(): \Generator
+    public function provideDescribeCommandCases(): iterable
     {
         $factory = new FixerFactory();
         $factory->registerBuiltInFixers();

+ 1 - 1
tests/AutoReview/DocumentationTest.php

@@ -93,7 +93,7 @@ final class DocumentationTest extends TestCase
         static::assertSame($expected, $actual);
     }
 
-    public function provideFixerCases(): \Generator
+    public function provideFixerCases(): iterable
     {
         foreach ($this->getFixers() as $fixer) {
             yield $fixer->getName() => [$fixer];

+ 1 - 1
tests/AutoReview/FixerFactoryTest.php

@@ -150,7 +150,7 @@ final class FixerFactoryTest extends TestCase
         );
     }
 
-    public function provideIntegrationTestFilesCases(): \Generator
+    public function provideIntegrationTestFilesCases(): iterable
     {
         foreach (new \DirectoryIterator(self::getIntegrationPriorityDirectory()) as $candidate) {
             if (!$candidate->isDot()) {

+ 3 - 3
tests/AutoReview/ProjectCodeTest.php

@@ -681,7 +681,7 @@ final class ProjectCodeTest extends TestCase
         static::assertTrue($reflection->isSubclassOf(\PhpCsFixer\Fixer\AbstractPhpUnitFixer::class));
     }
 
-    public function providePhpUnitFixerExtendsAbstractPhpUnitFixerCases(): \Generator
+    public function providePhpUnitFixerExtendsAbstractPhpUnitFixerCases(): iterable
     {
         $factory = new FixerFactory();
         $factory->registerBuiltInFixers();
@@ -726,7 +726,7 @@ final class ProjectCodeTest extends TestCase
         }
     }
 
-    private function getUsedDataProviderMethodNames(string $testClassName): \Generator
+    private function getUsedDataProviderMethodNames(string $testClassName): iterable
     {
         foreach ($this->getAnnotationsOfTestClass($testClassName, 'dataProvider') as $methodName => $dataProviderAnnotation) {
             if (1 === preg_match('/@dataProvider\s+(?P<methodName>\w+)/', $dataProviderAnnotation->getContent(), $matches)) {
@@ -735,7 +735,7 @@ final class ProjectCodeTest extends TestCase
         }
     }
 
-    private function getAnnotationsOfTestClass(string $testClassName, string $annotation): \Generator
+    private function getAnnotationsOfTestClass(string $testClassName, string $annotation): iterable
     {
         $tokens = Tokens::fromCode(file_get_contents(
             str_replace('\\', \DIRECTORY_SEPARATOR, preg_replace('#^PhpCsFixer\\\Tests#', 'tests', $testClassName)).'.php'

+ 1 - 1
tests/Cache/SignatureTest.php

@@ -74,7 +74,7 @@ final class SignatureTest extends TestCase
         static::assertFalse($signature->equals($anotherSignature));
     }
 
-    public function provideEqualsReturnsFalseIfValuesAreNotIdenticalCases(): \Generator
+    public function provideEqualsReturnsFalseIfValuesAreNotIdenticalCases(): iterable
     {
         $php = PHP_VERSION;
         $version = '2.0';

+ 2 - 2
tests/Console/Command/HelpCommandTest.php

@@ -36,7 +36,7 @@ final class HelpCommandTest extends TestCase
         static::assertSame($expected, HelpCommand::toString($input));
     }
 
-    public function provideToStringCases(): \Generator
+    public function provideToStringCases(): iterable
     {
         yield ["['a' => 3, 'b' => 'c']", ['a' => 3, 'b' => 'c']];
 
@@ -71,7 +71,7 @@ final class HelpCommandTest extends TestCase
         static::assertSame($expected, HelpCommand::getDisplayableAllowedValues($input));
     }
 
-    public function provideGetDisplayableAllowedValuesCases(): \Generator
+    public function provideGetDisplayableAllowedValuesCases(): iterable
     {
         yield [null, new FixerOption('foo', 'bar', false, null, ['int'], [])];
 

+ 3 - 3
tests/Console/ConfigurationResolverTest.php

@@ -297,7 +297,7 @@ final class ConfigurationResolverTest extends TestCase
         static::assertSame($expectedPaths, $resolver->getPath());
     }
 
-    public function providePathCases(): \Generator
+    public function providePathCases(): iterable
     {
         yield [
             ['Command'],
@@ -343,7 +343,7 @@ final class ConfigurationResolverTest extends TestCase
         $resolver->getPath();
     }
 
-    public function provideEmptyPathCases(): \Generator
+    public function provideEmptyPathCases(): iterable
     {
         yield [
             [''],
@@ -968,7 +968,7 @@ final class ConfigurationResolverTest extends TestCase
         $resolver->getRules();
     }
 
-    public function provideRenamedRulesCases(): \Generator
+    public function provideRenamedRulesCases(): iterable
     {
         yield 'with config' => [
             'The rules contain unknown fixers: "blank_line_before_return" is renamed (did you mean "blank_line_before_statement"? (note: use configuration "[\'statements\' => [\'return\']]")).

+ 7 - 7
tests/DocBlock/AnnotationTest.php

@@ -99,7 +99,7 @@ final class AnnotationTest extends TestCase
         static::assertSame($content, (string) $annotation);
     }
 
-    public function provideGetContentCases(): \Generator
+    public function provideGetContentCases(): iterable
     {
         foreach (self::$content as $index => $content) {
             yield [$index, $content];
@@ -117,7 +117,7 @@ final class AnnotationTest extends TestCase
         static::assertSame($start, $annotation->getStart());
     }
 
-    public function provideStartCases(): \Generator
+    public function provideStartCases(): iterable
     {
         foreach (self::$start as $index => $start) {
             yield [$index, $start];
@@ -135,7 +135,7 @@ final class AnnotationTest extends TestCase
         static::assertSame($end, $annotation->getEnd());
     }
 
-    public function provideEndCases(): \Generator
+    public function provideEndCases(): iterable
     {
         foreach (self::$end as $index => $end) {
             yield [$index, $end];
@@ -153,7 +153,7 @@ final class AnnotationTest extends TestCase
         static::assertSame($tag, $annotation->getTag()->getName());
     }
 
-    public function provideGetTagCases(): \Generator
+    public function provideGetTagCases(): iterable
     {
         foreach (self::$tags as $index => $tag) {
             yield [$index, $tag];
@@ -174,7 +174,7 @@ final class AnnotationTest extends TestCase
         static::assertSame('', $doc->getLine($end)->getContent());
     }
 
-    public function provideRemoveCases(): \Generator
+    public function provideRemoveCases(): iterable
     {
         foreach (self::$start as $index => $start) {
             yield [$index, $start, self::$end[$index]];
@@ -553,7 +553,7 @@ final class AnnotationTest extends TestCase
         static::assertSame($expectedCommonType, $result->getCommonType());
     }
 
-    public function provideTypeExpressionCases(): \Generator
+    public function provideTypeExpressionCases(): iterable
     {
         $appNamespace = new NamespaceAnalysis('App', 'App', 0, 999, 0, 999);
         $useTraversable = new NamespaceUseAnalysis('Traversable', 'Traversable', false, 0, 999, NamespaceUseAnalysis::TYPE_CLASS);
@@ -574,7 +574,7 @@ final class AnnotationTest extends TestCase
         static::assertSame($expectedVariableName, $annotation->getVariableName());
     }
 
-    public function provideGetVariableCases(): \Generator
+    public function provideGetVariableCases(): iterable
     {
         yield ['* @param int $foo', '$foo'];
 

+ 3 - 3
tests/DocBlock/LineTest.php

@@ -141,7 +141,7 @@ final class LineTest extends TestCase
         static::assertSame(14 === $pos, $line->isTheEnd());
     }
 
-    public function provideLinesCases(): \Generator
+    public function provideLinesCases(): iterable
     {
         foreach (self::$content as $index => $content) {
             yield [$index, $content];
@@ -159,7 +159,7 @@ final class LineTest extends TestCase
         static::assertSame($useful, $line->containsUsefulContent());
     }
 
-    public function provideLinesWithUsefulCases(): \Generator
+    public function provideLinesWithUsefulCases(): iterable
     {
         foreach (self::$useful as $index => $useful) {
             yield [$index, $useful];
@@ -177,7 +177,7 @@ final class LineTest extends TestCase
         static::assertSame($tag, $line->containsATag());
     }
 
-    public function provideLinesWithTagCases(): \Generator
+    public function provideLinesWithTagCases(): iterable
     {
         foreach (self::$tag as $index => $tag) {
             yield [$index, $tag];

Некоторые файлы не были показаны из-за большого количества измененных файлов