Browse Source

DX: apply `ReturnToYieldFromFixer` (#7181)

Kuba Werłos 1 year ago
parent
commit
587def308a

+ 3 - 4
tests/AbstractDoctrineAnnotationFixerTestCase.php

@@ -36,10 +36,9 @@ abstract class AbstractDoctrineAnnotationFixerTestCase extends AbstractFixerTest
 
     public static function provideConfigureWithInvalidConfigurationCases(): iterable
     {
-        return [
-            [['foo' => 'bar']],
-            [['ignored_tags' => 'foo']],
-        ];
+        yield [['foo' => 'bar']];
+
+        yield [['ignored_tags' => 'foo']];
     }
 
     /**

+ 53 - 47
tests/AbstractFunctionReferenceFixerTest.php

@@ -57,62 +57,68 @@ final class AbstractFunctionReferenceFixerTest extends TestCase
 
     public static function provideAbstractFunctionReferenceFixerCases(): iterable
     {
-        return [
-            'simple case I' => [
-                [1, 2, 3],
-                '<?php foo();',
-                'foo',
-            ],
-            'simple case II' => [
-                [2, 3, 4],
-                '<?php \foo();',
-                'foo',
-            ],
-            'test start offset' => [
-                null,
-                '<?php
+        yield 'simple case I' => [
+            [1, 2, 3],
+            '<?php foo();',
+            'foo',
+        ];
+
+        yield 'simple case II' => [
+            [2, 3, 4],
+            '<?php \foo();',
+            'foo',
+        ];
+
+        yield 'test start offset' => [
+            null,
+            '<?php
                     foo();
                     bar();
                 ',
-                'foo',
-                5,
-            ],
-            'test returns only the first candidate' => [
-                [2, 3, 4],
-                '<?php
+            'foo',
+            5,
+        ];
+
+        yield 'test returns only the first candidate' => [
+            [2, 3, 4],
+            '<?php
                     foo();
                     foo();
                     foo();
                     foo();
                     foo();
                 ',
-                'foo',
-            ],
-            'not found I' => [
-                null,
-                '<?php foo();',
-                'bar',
-            ],
-            'not found II' => [
-                null,
-                '<?php $foo();',
-                'foo',
-            ],
-            'not found III' => [
-                null,
-                '<?php function foo(){}',
-                'foo',
-            ],
-            'not found IIIb' => [
-                null,
-                '<?php function foo($a){}',
-                'foo',
-            ],
-            'not found IV' => [
-                null,
-                '<?php \A\foo();',
-                'foo',
-            ],
+            'foo',
+        ];
+
+        yield 'not found I' => [
+            null,
+            '<?php foo();',
+            'bar',
+        ];
+
+        yield 'not found II' => [
+            null,
+            '<?php $foo();',
+            'foo',
+        ];
+
+        yield 'not found III' => [
+            null,
+            '<?php function foo(){}',
+            'foo',
+        ];
+
+        yield 'not found IIIb' => [
+            null,
+            '<?php function foo($a){}',
+            'foo',
+        ];
+
+        yield 'not found IV' => [
+            null,
+            '<?php \A\foo();',
+            'foo',
         ];
     }
 }

+ 33 - 19
tests/AutoReview/TransformerTest.php

@@ -78,25 +78,39 @@ final class TransformerTest extends TestCase
             $transformers[$transformer->getName()] = $transformer;
         }
 
-        return [
-            [$transformers['attribute'], $transformers['curly_brace']],
-            [$transformers['attribute'], $transformers['square_brace']],
-            [$transformers['curly_brace'], $transformers['brace_class_instantiation']],
-            [$transformers['curly_brace'], $transformers['import']],
-            [$transformers['curly_brace'], $transformers['use']],
-            [$transformers['name_qualified'], $transformers['namespace_operator']],
-            [$transformers['return_ref'], $transformers['import']],
-            [$transformers['return_ref'], $transformers['type_colon']],
-            [$transformers['square_brace'], $transformers['brace_class_instantiation']],
-            [$transformers['type_colon'], $transformers['named_argument']],
-            [$transformers['type_colon'], $transformers['nullable_type']],
-            [$transformers['array_typehint'], $transformers['type_alternation']],
-            [$transformers['type_colon'], $transformers['type_alternation']],
-            [$transformers['array_typehint'], $transformers['type_intersection']],
-            [$transformers['type_colon'], $transformers['type_intersection']],
-            [$transformers['type_alternation'], $transformers['disjunctive_normal_form_type_parenthesis']],
-            [$transformers['use'], $transformers['type_colon']],
-        ];
+        yield [$transformers['attribute'], $transformers['curly_brace']];
+
+        yield [$transformers['attribute'], $transformers['square_brace']];
+
+        yield [$transformers['curly_brace'], $transformers['brace_class_instantiation']];
+
+        yield [$transformers['curly_brace'], $transformers['import']];
+
+        yield [$transformers['curly_brace'], $transformers['use']];
+
+        yield [$transformers['name_qualified'], $transformers['namespace_operator']];
+
+        yield [$transformers['return_ref'], $transformers['import']];
+
+        yield [$transformers['return_ref'], $transformers['type_colon']];
+
+        yield [$transformers['square_brace'], $transformers['brace_class_instantiation']];
+
+        yield [$transformers['type_colon'], $transformers['named_argument']];
+
+        yield [$transformers['type_colon'], $transformers['nullable_type']];
+
+        yield [$transformers['array_typehint'], $transformers['type_alternation']];
+
+        yield [$transformers['type_colon'], $transformers['type_alternation']];
+
+        yield [$transformers['array_typehint'], $transformers['type_intersection']];
+
+        yield [$transformers['type_colon'], $transformers['type_intersection']];
+
+        yield [$transformers['type_alternation'], $transformers['disjunctive_normal_form_type_parenthesis']];
+
+        yield [$transformers['use'], $transformers['type_colon']];
     }
 
     /**

+ 21 - 22
tests/Cache/CacheTest.php

@@ -163,28 +163,27 @@ final class CacheTest extends TestCase
         $toolInfo = new ToolInfo();
         $config = new Config();
 
-        return [
-            [new Signature(
-                PHP_VERSION,
-                '2.0',
-                '  ',
-                "\r\n",
-                [
-                    'foo' => true,
-                    'bar' => true,
-                ]
-            )],
-            [new Signature(
-                PHP_VERSION,
-                $toolInfo->getVersion(),
-                $config->getIndent(),
-                $config->getLineEnding(),
-                [
-                    // value encoded in ANSI, not UTF
-                    'header_comment' => ['header' => 'Dariusz '.base64_decode('UnVtafFza2k=', true)],
-                ]
-            )],
-        ];
+        yield [new Signature(
+            PHP_VERSION,
+            '2.0',
+            '  ',
+            "\r\n",
+            [
+                'foo' => true,
+                'bar' => true,
+            ]
+        )];
+
+        yield [new Signature(
+            PHP_VERSION,
+            $toolInfo->getVersion(),
+            $config->getIndent(),
+            $config->getLineEnding(),
+            [
+                // value encoded in ANSI, not UTF
+                'header_comment' => ['header' => 'Dariusz '.base64_decode('UnVtafFza2k=', true)],
+            ]
+        )];
     }
 
     public function testToJsonThrowsExceptionOnInvalid(): void

+ 3 - 4
tests/ConfigTest.php

@@ -255,10 +255,9 @@ final class ConfigTest extends TestCase
             new IncludeFixer(),
         ];
 
-        return [
-            [$fixers, $fixers],
-            [$fixers, new \ArrayIterator($fixers)],
-        ];
+        yield [$fixers, $fixers];
+
+        yield [$fixers, new \ArrayIterator($fixers)];
     }
 
     public function testConfigConstructorWithName(): void

+ 25 - 15
tests/Console/Command/FixCommandExitStatusCalculatorTest.php

@@ -42,20 +42,30 @@ final class FixCommandExitStatusCalculatorTest extends TestCase
 
     public static function provideCalculateCases(): iterable
     {
-        return [
-            [0, true, false, false, false, false],
-            [0, false, false, false, false, false],
-            [8, true, true, false, false, false],
-            [0, false, true, false, false, false],
-            [4, true, false, true, false, false],
-            [0, false, false, true, false, false],
-            [12, true, true, true, false, false],
-            [0, false, true, true, false, false],
-            [76, true, true, true, true, false],
-            [64, false, false, false, false, true],
-            [64, false, false, false, true, false],
-            [64, false, false, false, true, true],
-            [8 | 64, true, true, false, true, true],
-        ];
+        yield [0, true, false, false, false, false];
+
+        yield [0, false, false, false, false, false];
+
+        yield [8, true, true, false, false, false];
+
+        yield [0, false, true, false, false, false];
+
+        yield [4, true, false, true, false, false];
+
+        yield [0, false, false, true, false, false];
+
+        yield [12, true, true, true, false, false];
+
+        yield [0, false, true, true, false, false];
+
+        yield [76, true, true, true, true, false];
+
+        yield [64, false, false, false, false, true];
+
+        yield [64, false, false, false, true, false];
+
+        yield [64, false, false, false, true, true];
+
+        yield [8 | 64, true, true, false, true, true];
     }
 }

+ 149 - 91
tests/Console/Command/SelfUpdateCommandTest.php

@@ -83,10 +83,9 @@ final class SelfUpdateCommandTest extends TestCase
 
     public static function provideCommandNameCases(): iterable
     {
-        return [
-            ['self-update'],
-            ['selfupdate'],
-        ];
+        yield ['self-update'];
+
+        yield ['selfupdate'];
     }
 
     /**
@@ -166,65 +165,106 @@ OUTPUT;
 
 OUTPUT;
 
-        return [
-            // no new version available
-            [Application::VERSION, Application::VERSION, [], true, $currentContents, $upToDateDisplay],
-            [Application::VERSION, Application::VERSION, [], false, $currentContents, $upToDateDisplay],
-            [Application::VERSION, Application::VERSION, ['--force' => true], true, $currentContents, $upToDateDisplay],
-            [Application::VERSION, Application::VERSION, ['-f' => true], false, $currentContents, $upToDateDisplay],
-            [Application::VERSION, Application::VERSION, ['--force' => true], true, $currentContents, $upToDateDisplay],
-            [Application::VERSION, Application::VERSION, ['-f' => true], false, $currentContents, $upToDateDisplay],
-
-            // new minor version available
-            [$minorRelease, $minorRelease, [], true, $minorContents, $newMinorDisplay],
-            [$minorRelease, $minorRelease, ['--force' => true], true, $minorContents, $newMinorDisplay],
-            [$minorRelease, $minorRelease, ['-f' => true], true, $minorContents, $newMinorDisplay],
-            [$minorRelease, $minorRelease, [], false, $minorContents, $newMinorDisplay],
-            [$minorRelease, $minorRelease, ['--force' => true], false, $minorContents, $newMinorDisplay],
-            [$minorRelease, $minorRelease, ['-f' => true], false, $minorContents, $newMinorDisplay],
-
-            // new major version available
-            [$majorRelease, Application::VERSION, [], true, $currentContents, $majorInfoNoMinorDisplay],
-            [$majorRelease, Application::VERSION, [], false, $currentContents, $majorInfoNoMinorDisplay],
-            [$majorRelease, Application::VERSION, ['--force' => true], true, $majorContents, $newMajorDisplay],
-            [$majorRelease, Application::VERSION, ['-f' => true], false, $majorContents, $newMajorDisplay],
-            [$majorRelease, Application::VERSION, ['--force' => true], true, $majorContents, $newMajorDisplay],
-            [$majorRelease, Application::VERSION, ['-f' => true], false, $majorContents, $newMajorDisplay],
-
-            // new minor version and new major version available
-            [$majorRelease, $minorRelease, [], true, $minorContents, $majorInfoNewMinorDisplay],
-            [$majorRelease, $minorRelease, [], false, $minorContents, $majorInfoNewMinorDisplay],
-            [$majorRelease, $minorRelease, ['--force' => true], true, $majorContents, $newMajorDisplay],
-            [$majorRelease, $minorRelease, ['-f' => true], false, $majorContents, $newMajorDisplay],
-            [$majorRelease, $minorRelease, ['--force' => true], true, $majorContents, $newMajorDisplay],
-            [$majorRelease, $minorRelease, ['-f' => true], false, $majorContents, $newMajorDisplay],
-
-            // weird/unexpected versions
-            ['v0.1.0', 'v0.1.0', [], true, $currentContents, $upToDateDisplay],
-            ['v0.1.0', 'v0.1.0', [], false, $currentContents, $upToDateDisplay],
-            ['v0.1.0', 'v0.1.0', ['--force' => true], true, $currentContents, $upToDateDisplay],
-            ['v0.1.0', 'v0.1.0', ['-f' => true], false, $currentContents, $upToDateDisplay],
-            ['v0.1.0', 'v0.1.0', ['--force' => true], true, $currentContents, $upToDateDisplay],
-            ['v0.1.0', 'v0.1.0', ['-f' => true], false, $currentContents, $upToDateDisplay],
-            ['v0.1.0', null, [], true, $currentContents, $upToDateDisplay],
-            ['v0.1.0', null, [], false, $currentContents, $upToDateDisplay],
-            ['v0.1.0', null, ['--force' => true], true, $currentContents, $upToDateDisplay],
-            ['v0.1.0', null, ['-f' => true], false, $currentContents, $upToDateDisplay],
-            ['v0.1.0', null, ['--force' => true], true, $currentContents, $upToDateDisplay],
-            ['v0.1.0', null, ['-f' => true], false, $currentContents, $upToDateDisplay],
-            ['v0.1.0', Application::VERSION, [], true, $currentContents, $upToDateDisplay],
-            ['v0.1.0', Application::VERSION, [], false, $currentContents, $upToDateDisplay],
-            ['v0.1.0', Application::VERSION, ['--force' => true], true, $currentContents, $upToDateDisplay],
-            ['v0.1.0', Application::VERSION, ['-f' => true], false, $currentContents, $upToDateDisplay],
-            ['v0.1.0', Application::VERSION, ['--force' => true], true, $currentContents, $upToDateDisplay],
-            ['v0.1.0', Application::VERSION, ['-f' => true], false, $currentContents, $upToDateDisplay],
-            [Application::VERSION, 'v0.1.0', [], true, $currentContents, $upToDateDisplay],
-            [Application::VERSION, 'v0.1.0', [], false, $currentContents, $upToDateDisplay],
-            [Application::VERSION, 'v0.1.0', ['--force' => true], true, $currentContents, $upToDateDisplay],
-            [Application::VERSION, 'v0.1.0', ['-f' => true], false, $currentContents, $upToDateDisplay],
-            [Application::VERSION, 'v0.1.0', ['--force' => true], true, $currentContents, $upToDateDisplay],
-            [Application::VERSION, 'v0.1.0', ['-f' => true], false, $currentContents, $upToDateDisplay],
-        ];
+        // no new version available
+        yield [Application::VERSION, Application::VERSION, [], true, $currentContents, $upToDateDisplay];
+
+        yield [Application::VERSION, Application::VERSION, [], false, $currentContents, $upToDateDisplay];
+
+        yield [Application::VERSION, Application::VERSION, ['--force' => true], true, $currentContents, $upToDateDisplay];
+
+        yield [Application::VERSION, Application::VERSION, ['-f' => true], false, $currentContents, $upToDateDisplay];
+
+        yield [Application::VERSION, Application::VERSION, ['--force' => true], true, $currentContents, $upToDateDisplay];
+
+        yield [Application::VERSION, Application::VERSION, ['-f' => true], false, $currentContents, $upToDateDisplay];
+
+        // new minor version available
+        yield [$minorRelease, $minorRelease, [], true, $minorContents, $newMinorDisplay];
+
+        yield [$minorRelease, $minorRelease, ['--force' => true], true, $minorContents, $newMinorDisplay];
+
+        yield [$minorRelease, $minorRelease, ['-f' => true], true, $minorContents, $newMinorDisplay];
+
+        yield [$minorRelease, $minorRelease, [], false, $minorContents, $newMinorDisplay];
+
+        yield [$minorRelease, $minorRelease, ['--force' => true], false, $minorContents, $newMinorDisplay];
+
+        yield [$minorRelease, $minorRelease, ['-f' => true], false, $minorContents, $newMinorDisplay];
+
+        // new major version available
+        yield [$majorRelease, Application::VERSION, [], true, $currentContents, $majorInfoNoMinorDisplay];
+
+        yield [$majorRelease, Application::VERSION, [], false, $currentContents, $majorInfoNoMinorDisplay];
+
+        yield [$majorRelease, Application::VERSION, ['--force' => true], true, $majorContents, $newMajorDisplay];
+
+        yield [$majorRelease, Application::VERSION, ['-f' => true], false, $majorContents, $newMajorDisplay];
+
+        yield [$majorRelease, Application::VERSION, ['--force' => true], true, $majorContents, $newMajorDisplay];
+
+        yield [$majorRelease, Application::VERSION, ['-f' => true], false, $majorContents, $newMajorDisplay];
+
+        // new minor version and new major version available
+        yield [$majorRelease, $minorRelease, [], true, $minorContents, $majorInfoNewMinorDisplay];
+
+        yield [$majorRelease, $minorRelease, [], false, $minorContents, $majorInfoNewMinorDisplay];
+
+        yield [$majorRelease, $minorRelease, ['--force' => true], true, $majorContents, $newMajorDisplay];
+
+        yield [$majorRelease, $minorRelease, ['-f' => true], false, $majorContents, $newMajorDisplay];
+
+        yield [$majorRelease, $minorRelease, ['--force' => true], true, $majorContents, $newMajorDisplay];
+
+        yield [$majorRelease, $minorRelease, ['-f' => true], false, $majorContents, $newMajorDisplay];
+
+        // weird/unexpected versions
+        yield ['v0.1.0', 'v0.1.0', [], true, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', 'v0.1.0', [], false, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', 'v0.1.0', ['--force' => true], true, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', 'v0.1.0', ['-f' => true], false, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', 'v0.1.0', ['--force' => true], true, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', 'v0.1.0', ['-f' => true], false, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', null, [], true, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', null, [], false, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', null, ['--force' => true], true, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', null, ['-f' => true], false, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', null, ['--force' => true], true, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', null, ['-f' => true], false, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', Application::VERSION, [], true, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', Application::VERSION, [], false, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', Application::VERSION, ['--force' => true], true, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', Application::VERSION, ['-f' => true], false, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', Application::VERSION, ['--force' => true], true, $currentContents, $upToDateDisplay];
+
+        yield ['v0.1.0', Application::VERSION, ['-f' => true], false, $currentContents, $upToDateDisplay];
+
+        yield [Application::VERSION, 'v0.1.0', [], true, $currentContents, $upToDateDisplay];
+
+        yield [Application::VERSION, 'v0.1.0', [], false, $currentContents, $upToDateDisplay];
+
+        yield [Application::VERSION, 'v0.1.0', ['--force' => true], true, $currentContents, $upToDateDisplay];
+
+        yield [Application::VERSION, 'v0.1.0', ['-f' => true], false, $currentContents, $upToDateDisplay];
+
+        yield [Application::VERSION, 'v0.1.0', ['--force' => true], true, $currentContents, $upToDateDisplay];
+
+        yield [Application::VERSION, 'v0.1.0', ['-f' => true], false, $currentContents, $upToDateDisplay];
     }
 
     /**
@@ -278,26 +318,41 @@ OUTPUT;
 
     public static function provideExecuteWhenNotAbleToGetLatestVersionsCases(): iterable
     {
-        return [
-            [false, false, [], true],
-            [false, false, ['--force' => true], true],
-            [false, false, ['-f' => true], true],
-            [false, false, [], false],
-            [false, false, ['--force' => true], false],
-            [false, false, ['-f' => true], false],
-            [true, false, [], true],
-            [true, false, ['--force' => true], true],
-            [true, false, ['-f' => true], true],
-            [true, false, [], false],
-            [true, false, ['--force' => true], false],
-            [true, false, ['-f' => true], false],
-            [false, true, [], true],
-            [false, true, ['--force' => true], true],
-            [false, true, ['-f' => true], true],
-            [false, true, [], false],
-            [false, true, ['--force' => true], false],
-            [false, true, ['-f' => true], false],
-        ];
+        yield [false, false, [], true];
+
+        yield [false, false, ['--force' => true], true];
+
+        yield [false, false, ['-f' => true], true];
+
+        yield [false, false, [], false];
+
+        yield [false, false, ['--force' => true], false];
+
+        yield [false, false, ['-f' => true], false];
+
+        yield [true, false, [], true];
+
+        yield [true, false, ['--force' => true], true];
+
+        yield [true, false, ['-f' => true], true];
+
+        yield [true, false, [], false];
+
+        yield [true, false, ['--force' => true], false];
+
+        yield [true, false, ['-f' => true], false];
+
+        yield [false, true, [], true];
+
+        yield [false, true, ['--force' => true], true];
+
+        yield [false, true, ['-f' => true], true];
+
+        yield [false, true, [], false];
+
+        yield [false, true, ['--force' => true], false];
+
+        yield [false, true, ['-f' => true], false];
     }
 
     /**
@@ -324,14 +379,17 @@ OUTPUT;
 
     public static function provideExecuteWhenNotInstalledAsPharCases(): iterable
     {
-        return [
-            [[], true],
-            [['--force' => true], true],
-            [['-f' => true], true],
-            [[], false],
-            [['--force' => true], false],
-            [['-f' => true], false],
-        ];
+        yield [[], true];
+
+        yield [['--force' => true], true];
+
+        yield [['-f' => true], true];
+
+        yield [[], false];
+
+        yield [['--force' => true], false];
+
+        yield [['-f' => true], false];
     }
 
     /**

+ 258 - 232
tests/Console/ConfigurationResolverTest.php

@@ -199,34 +199,36 @@ final class ConfigurationResolverTest extends TestCase
     {
         $dirBase = self::getFixtureDir();
 
-        return [
-            [
-                $dirBase.'case_1'.\DIRECTORY_SEPARATOR.'.php-cs-fixer.dist.php',
-                'Test1Config',
-                $dirBase.'case_1',
-            ],
-            [
-                $dirBase.'case_2'.\DIRECTORY_SEPARATOR.'.php-cs-fixer.php',
-                'Test2Config',
-                $dirBase.'case_2',
-            ],
-            [
-                $dirBase.'case_3'.\DIRECTORY_SEPARATOR.'.php-cs-fixer.php',
-                'Test3Config',
-                $dirBase.'case_3',
-            ],
-            [
-                $dirBase.'case_6'.\DIRECTORY_SEPARATOR.'.php-cs-fixer.dist.php',
-                'Test6Config',
-                $dirBase.'case_6'.\DIRECTORY_SEPARATOR.'subdir',
-                $dirBase.'case_6',
-            ],
-            [
-                $dirBase.'case_6'.\DIRECTORY_SEPARATOR.'.php-cs-fixer.dist.php',
-                'Test6Config',
-                $dirBase.'case_6'.\DIRECTORY_SEPARATOR.'subdir/empty_file.php',
-                $dirBase.'case_6',
-            ],
+        yield [
+            $dirBase.'case_1'.\DIRECTORY_SEPARATOR.'.php-cs-fixer.dist.php',
+            'Test1Config',
+            $dirBase.'case_1',
+        ];
+
+        yield [
+            $dirBase.'case_2'.\DIRECTORY_SEPARATOR.'.php-cs-fixer.php',
+            'Test2Config',
+            $dirBase.'case_2',
+        ];
+
+        yield [
+            $dirBase.'case_3'.\DIRECTORY_SEPARATOR.'.php-cs-fixer.php',
+            'Test3Config',
+            $dirBase.'case_3',
+        ];
+
+        yield [
+            $dirBase.'case_6'.\DIRECTORY_SEPARATOR.'.php-cs-fixer.dist.php',
+            'Test6Config',
+            $dirBase.'case_6'.\DIRECTORY_SEPARATOR.'subdir',
+            $dirBase.'case_6',
+        ];
+
+        yield [
+            $dirBase.'case_6'.\DIRECTORY_SEPARATOR.'.php-cs-fixer.dist.php',
+            'Test6Config',
+            $dirBase.'case_6'.\DIRECTORY_SEPARATOR.'subdir/empty_file.php',
+            $dirBase.'case_6',
         ];
     }
 
@@ -510,142 +512,158 @@ final class ConfigurationResolverTest extends TestCase
             );
         };
 
-        return [
-            'no path at all' => [
-                new \LogicException(),
-                Finder::create(),
-                [],
-                'override',
-            ],
-            'configured only by finder' => [
-                // don't override if the argument is empty
-                $cb(['a1.php', 'a2.php', 'b/b1.php', 'b/b2.php', 'b_b/b_b1.php', 'c/c1.php', 'c/d/cd1.php', 'd/d1.php', 'd/d2.php', 'd/e/de1.php', 'd/f/df1.php']),
-                Finder::create()
-                    ->in($dir),
-                [],
-                'override',
-            ],
-            'configured only by argument' => [
-                $cb(['a1.php', 'a2.php', 'b/b1.php', 'b/b2.php', 'b_b/b_b1.php', 'c/c1.php', 'c/d/cd1.php', 'd/d1.php', 'd/d2.php', 'd/e/de1.php', 'd/f/df1.php']),
-                Finder::create(),
-                [$dir],
-                'override',
-            ],
-            'configured by finder, intersected with empty argument' => [
-                [],
-                Finder::create()
-                    ->in($dir),
-                [],
-                'intersection',
-            ],
-            'configured by finder, intersected with dir' => [
-                $cb(['c/c1.php', 'c/d/cd1.php']),
-                Finder::create()
-                    ->in($dir),
-                [$dir.'/c'],
-                'intersection',
-            ],
-            'configured by finder, intersected with file' => [
-                $cb(['c/c1.php']),
-                Finder::create()
-                    ->in($dir),
-                [$dir.'/c/c1.php'],
-                'intersection',
-            ],
-            'finder points to one dir while argument to another, not connected' => [
-                [],
-                Finder::create()
-                    ->in($dir.'/b'),
-                [$dir.'/c'],
-                'intersection',
-            ],
-            'finder with excluded dir, intersected with excluded file' => [
-                [],
-                Finder::create()
-                    ->in($dir)
-                    ->exclude('c'),
-                [$dir.'/c/d/cd1.php'],
-                'intersection',
-            ],
-            'finder with excluded dir, intersected with dir containing excluded one' => [
-                $cb(['c/c1.php']),
-                Finder::create()
-                    ->in($dir)
-                    ->exclude('c/d'),
-                [$dir.'/c'],
-                'intersection',
-            ],
-            'finder with excluded file, intersected with dir containing excluded one' => [
-                $cb(['c/d/cd1.php']),
-                Finder::create()
-                    ->in($dir)
-                    ->notPath('c/c1.php'),
-                [$dir.'/c'],
-                'intersection',
-            ],
-            'configured by finder, intersected with non-existing path' => [
-                new \LogicException(),
-                Finder::create()
-                    ->in($dir),
-                ['non_existing_dir'],
-                'intersection',
-            ],
-            'configured by config file, overridden by multiple files' => [
-                $cb(['d/d1.php', 'd/d2.php']),
-                null,
-                [$dir.'/d/d1.php', $dir.'/d/d2.php'],
-                'override',
-                $dir.'/d/.php-cs-fixer.php',
-            ],
-            'configured by config file, intersected with multiple files' => [
-                $cb(['d/d1.php', 'd/d2.php']),
-                null,
-                [$dir.'/d/d1.php', $dir.'/d/d2.php'],
-                'intersection',
-                $dir.'/d/.php-cs-fixer.php',
-            ],
-            'configured by config file, overridden by non-existing dir' => [
-                new \LogicException(),
-                null,
-                [$dir.'/d/fff'],
-                'override',
-                $dir.'/d/.php-cs-fixer.php',
-            ],
-            'configured by config file, intersected with non-existing dir' => [
-                new \LogicException(),
-                null,
-                [$dir.'/d/fff'],
-                'intersection',
-                $dir.'/d/.php-cs-fixer.php',
-            ],
-            'configured by config file, overridden by non-existing file' => [
-                new \LogicException(),
-                null,
-                [$dir.'/d/fff.php'],
-                'override',
-                $dir.'/d/.php-cs-fixer.php',
-            ],
-            'configured by config file, intersected with non-existing file' => [
-                new \LogicException(),
-                null,
-                [$dir.'/d/fff.php'],
-                'intersection',
-                $dir.'/d/.php-cs-fixer.php',
-            ],
-            'configured by config file, overridden by multiple files and dirs' => [
-                $cb(['d/d1.php', 'd/e/de1.php', 'd/f/df1.php']),
-                null,
-                [$dir.'/d/d1.php', $dir.'/d/e', $dir.'/d/f/'],
-                'override',
-                $dir.'/d/.php-cs-fixer.php',
-            ],
-            'configured by config file, intersected with multiple files and dirs' => [
-                $cb(['d/d1.php', 'd/e/de1.php', 'd/f/df1.php']),
-                null,
-                [$dir.'/d/d1.php', $dir.'/d/e', $dir.'/d/f/'],
-                'intersection',
-                $dir.'/d/.php-cs-fixer.php',
-            ],
+        yield 'no path at all' => [
+            new \LogicException(),
+            Finder::create(),
+            [],
+            'override',
+        ];
+
+        yield 'configured only by finder' => [
+            // don't override if the argument is empty
+            $cb(['a1.php', 'a2.php', 'b/b1.php', 'b/b2.php', 'b_b/b_b1.php', 'c/c1.php', 'c/d/cd1.php', 'd/d1.php', 'd/d2.php', 'd/e/de1.php', 'd/f/df1.php']),
+            Finder::create()
+                ->in($dir),
+            [],
+            'override',
+        ];
+
+        yield 'configured only by argument' => [
+            $cb(['a1.php', 'a2.php', 'b/b1.php', 'b/b2.php', 'b_b/b_b1.php', 'c/c1.php', 'c/d/cd1.php', 'd/d1.php', 'd/d2.php', 'd/e/de1.php', 'd/f/df1.php']),
+            Finder::create(),
+            [$dir],
+            'override',
+        ];
+
+        yield 'configured by finder, intersected with empty argument' => [
+            [],
+            Finder::create()
+                ->in($dir),
+            [],
+            'intersection',
+        ];
+
+        yield 'configured by finder, intersected with dir' => [
+            $cb(['c/c1.php', 'c/d/cd1.php']),
+            Finder::create()
+                ->in($dir),
+            [$dir.'/c'],
+            'intersection',
+        ];
+
+        yield 'configured by finder, intersected with file' => [
+            $cb(['c/c1.php']),
+            Finder::create()
+                ->in($dir),
+            [$dir.'/c/c1.php'],
+            'intersection',
+        ];
+
+        yield 'finder points to one dir while argument to another, not connected' => [
+            [],
+            Finder::create()
+                ->in($dir.'/b'),
+            [$dir.'/c'],
+            'intersection',
+        ];
+
+        yield 'finder with excluded dir, intersected with excluded file' => [
+            [],
+            Finder::create()
+                ->in($dir)
+                ->exclude('c'),
+            [$dir.'/c/d/cd1.php'],
+            'intersection',
+        ];
+
+        yield 'finder with excluded dir, intersected with dir containing excluded one' => [
+            $cb(['c/c1.php']),
+            Finder::create()
+                ->in($dir)
+                ->exclude('c/d'),
+            [$dir.'/c'],
+            'intersection',
+        ];
+
+        yield 'finder with excluded file, intersected with dir containing excluded one' => [
+            $cb(['c/d/cd1.php']),
+            Finder::create()
+                ->in($dir)
+                ->notPath('c/c1.php'),
+            [$dir.'/c'],
+            'intersection',
+        ];
+
+        yield 'configured by finder, intersected with non-existing path' => [
+            new \LogicException(),
+            Finder::create()
+                ->in($dir),
+            ['non_existing_dir'],
+            'intersection',
+        ];
+
+        yield 'configured by config file, overridden by multiple files' => [
+            $cb(['d/d1.php', 'd/d2.php']),
+            null,
+            [$dir.'/d/d1.php', $dir.'/d/d2.php'],
+            'override',
+            $dir.'/d/.php-cs-fixer.php',
+        ];
+
+        yield 'configured by config file, intersected with multiple files' => [
+            $cb(['d/d1.php', 'd/d2.php']),
+            null,
+            [$dir.'/d/d1.php', $dir.'/d/d2.php'],
+            'intersection',
+            $dir.'/d/.php-cs-fixer.php',
+        ];
+
+        yield 'configured by config file, overridden by non-existing dir' => [
+            new \LogicException(),
+            null,
+            [$dir.'/d/fff'],
+            'override',
+            $dir.'/d/.php-cs-fixer.php',
+        ];
+
+        yield 'configured by config file, intersected with non-existing dir' => [
+            new \LogicException(),
+            null,
+            [$dir.'/d/fff'],
+            'intersection',
+            $dir.'/d/.php-cs-fixer.php',
+        ];
+
+        yield 'configured by config file, overridden by non-existing file' => [
+            new \LogicException(),
+            null,
+            [$dir.'/d/fff.php'],
+            'override',
+            $dir.'/d/.php-cs-fixer.php',
+        ];
+
+        yield 'configured by config file, intersected with non-existing file' => [
+            new \LogicException(),
+            null,
+            [$dir.'/d/fff.php'],
+            'intersection',
+            $dir.'/d/.php-cs-fixer.php',
+        ];
+
+        yield 'configured by config file, overridden by multiple files and dirs' => [
+            $cb(['d/d1.php', 'd/e/de1.php', 'd/f/df1.php']),
+            null,
+            [$dir.'/d/d1.php', $dir.'/d/e', $dir.'/d/f/'],
+            'override',
+            $dir.'/d/.php-cs-fixer.php',
+        ];
+
+        yield 'configured by config file, intersected with multiple files and dirs' => [
+            $cb(['d/d1.php', 'd/e/de1.php', 'd/f/df1.php']),
+            null,
+            [$dir.'/d/d1.php', $dir.'/d/e', $dir.'/d/f/'],
+            'intersection',
+            $dir.'/d/.php-cs-fixer.php',
         ];
     }
 
@@ -670,54 +688,58 @@ final class ConfigurationResolverTest extends TestCase
     {
         $root = __DIR__.'/../..';
 
-        return [
-            [
-                [
-                    'config' => $root.'/.php-cs-fixer.dist.php',
-                ],
-                false,
-            ],
+        yield [
             [
-                [
-                    'config' => $root.'/.php-cs-fixer.dist.php',
-                    'path' => [$root.'/src'],
-                ],
-                true,
+                'config' => $root.'/.php-cs-fixer.dist.php',
             ],
+            false,
+        ];
+
+        yield [
             [
-                [],
-                false,
+                'config' => $root.'/.php-cs-fixer.dist.php',
+                'path' => [$root.'/src'],
             ],
+            true,
+        ];
+
+        yield [
+            [],
+            false,
+        ];
+
+        yield [
             [
-                [
-                    'path' => [$root.'/src'],
-                ],
-                false,
+                'path' => [$root.'/src'],
             ],
+            false,
+        ];
+
+        yield [
             [
-                [
-                    'config' => $root.'/.php-cs-fixer.dist.php',
-                    'path' => [$root.'/src'],
-                    'path-mode' => ConfigurationResolver::PATH_MODE_INTERSECTION,
-                ],
-                false,
+                'config' => $root.'/.php-cs-fixer.dist.php',
+                'path' => [$root.'/src'],
+                'path-mode' => ConfigurationResolver::PATH_MODE_INTERSECTION,
             ],
-            // scenario when loaded config is not setting custom finder
+            false,
+        ];
+
+        // scenario when loaded config is not setting custom finder
+        yield [
             [
-                [
-                    'config' => $root.'/tests/Fixtures/ConfigurationResolverConfigFile/case_3/.php-cs-fixer.dist.php',
-                    'path' => [$root.'/src'],
-                ],
-                false,
+                'config' => $root.'/tests/Fixtures/ConfigurationResolverConfigFile/case_3/.php-cs-fixer.dist.php',
+                'path' => [$root.'/src'],
             ],
-            // scenario when loaded config contains not fully defined finder
+            false,
+        ];
+
+        // scenario when loaded config contains not fully defined finder
+        yield [
             [
-                [
-                    'config' => $root.'/tests/Fixtures/ConfigurationResolverConfigFile/case_9/.php-cs-fixer.php',
-                    'path' => [$root.'/src'],
-                ],
-                false,
+                'config' => $root.'/tests/Fixtures/ConfigurationResolverConfigFile/case_9/.php-cs-fixer.php',
+                'path' => [$root.'/src'],
             ],
+            false,
         ];
     }
 
@@ -1082,19 +1104,19 @@ For more info about updating see: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/b
 
     public static function provideResolveDifferCases(): iterable
     {
-        return [
-            [
-                \PhpCsFixer\Differ\NullDiffer::class,
-                false,
-            ],
-            [
-                \PhpCsFixer\Differ\NullDiffer::class,
-                null,
-            ],
-            [
-                \PhpCsFixer\Differ\UnifiedDiffer::class,
-                true,
-            ],
+        yield [
+            \PhpCsFixer\Differ\NullDiffer::class,
+            false,
+        ];
+
+        yield [
+            \PhpCsFixer\Differ\NullDiffer::class,
+            null,
+        ];
+
+        yield [
+            \PhpCsFixer\Differ\UnifiedDiffer::class,
+            true,
         ];
     }
 
@@ -1123,14 +1145,17 @@ For more info about updating see: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/b
 
     public static function provideResolveBooleanOptionCases(): iterable
     {
-        return [
-            [true, true, 'yes'],
-            [true, false, 'yes'],
-            [false, true, 'no'],
-            [false, false, 'no'],
-            [true, true, null],
-            [false, false, null],
-        ];
+        yield [true, true, 'yes'];
+
+        yield [true, false, 'yes'];
+
+        yield [false, true, 'no'];
+
+        yield [false, false, 'no'];
+
+        yield [true, true, null];
+
+        yield [false, false, null];
     }
 
     public function testWithEmptyRules(): void
@@ -1164,21 +1189,22 @@ For more info about updating see: https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/b
 
     public static function provideDeprecatedFixerConfiguredCases(): iterable
     {
-        return [
-            [true],
-            [['foo' => true]],
-            [false],
-        ];
+        yield [true];
+
+        yield [['foo' => true]];
+
+        yield [false];
     }
 
     public static function provideGetDirectoryCases(): iterable
     {
-        return [
-            [null, '/my/path/my/file', 'my/file'],
-            ['/my/path/.php-cs-fixer.cache', '/my/path/my/file', 'my/file'],
-            ['/my/path2/dir/.php-cs-fixer.cache', '/my/path2/dir/dir2/file', 'dir2/file'],
-            ['dir/.php-cs-fixer.cache', '/my/path/dir/dir3/file', 'dir3/file'],
-        ];
+        yield [null, '/my/path/my/file', 'my/file'];
+
+        yield ['/my/path/.php-cs-fixer.cache', '/my/path/my/file', 'my/file'];
+
+        yield ['/my/path2/dir/.php-cs-fixer.cache', '/my/path2/dir/dir2/file', 'dir2/file'];
+
+        yield ['dir/.php-cs-fixer.cache', '/my/path/dir/dir3/file', 'dir3/file'];
     }
 
     /**

+ 108 - 101
tests/Console/Output/Progress/DotsOutputTest.php

@@ -52,127 +52,134 @@ final class DotsOutputTest extends TestCase
 
     public static function provideDotsProgressOutputCases(): iterable
     {
-        return [
+        yield [
             [
-                [
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 4],
-                ],
-                '....                                                                4 / 4 (100%)',
-                80,
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 4],
             ],
+            '....                                                                4 / 4 (100%)',
+            80,
+        ];
+
+        yield [
             [
-                [
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES],
-                    [FixerFileProcessedEvent::STATUS_FIXED],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 4],
-                ],
-                '.F....                                                              6 / 6 (100%)',
-                80,
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES],
+                [FixerFileProcessedEvent::STATUS_FIXED],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 4],
             ],
+            '.F....                                                              6 / 6 (100%)',
+            80,
+        ];
+
+        yield [
             [
-                [
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 65],
-                ],
-                '................................................................. 65 / 65 (100%)',
-                80,
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 65],
             ],
+            '................................................................. 65 / 65 (100%)',
+            80,
+        ];
+
+        yield [
             [
-                [
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 66],
-                ],
-                '................................................................. 65 / 66 ( 98%)'.PHP_EOL.
-                '.                                                                 66 / 66 (100%)',
-                80,
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 66],
             ],
+            '................................................................. 65 / 66 ( 98%)'.PHP_EOL.
+            '.                                                                 66 / 66 (100%)',
+            80,
+        ];
+
+        yield [
             [
-                [
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 66],
-                ],
-                '................................................................. 65 / 66 ( 98%)'.PHP_EOL.
-                '.                                                                 66 / 66 (100%)',
-                80,
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 66],
             ],
+            '................................................................. 65 / 66 ( 98%)'.PHP_EOL.
+            '.                                                                 66 / 66 (100%)',
+            80,
+        ];
+
+        yield [
             [
-                [
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 66],
-                ],
-                '......................... 25 / 66 ( 38%)'.PHP_EOL.
-                '......................... 50 / 66 ( 76%)'.PHP_EOL.
-                '................          66 / 66 (100%)',
-                40,
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 66],
             ],
+            '......................... 25 / 66 ( 38%)'.PHP_EOL.
+            '......................... 50 / 66 ( 76%)'.PHP_EOL.
+            '................          66 / 66 (100%)',
+            40,
+        ];
+
+        yield [
             [
-                [
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 66],
-                ],
-                '..................................................................                    66 / 66 (100%)',
-                100,
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 66],
             ],
+            '..................................................................                    66 / 66 (100%)',
+            100,
+        ];
+
+        yield [
             [
-                [
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 19],
-                    [FixerFileProcessedEvent::STATUS_EXCEPTION],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 6],
-                    [FixerFileProcessedEvent::STATUS_LINT],
-                    [FixerFileProcessedEvent::STATUS_FIXED, 3],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 50],
-                    [FixerFileProcessedEvent::STATUS_SKIPPED],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 49],
-                    [FixerFileProcessedEvent::STATUS_INVALID],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES],
-                    [FixerFileProcessedEvent::STATUS_INVALID],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 40],
-                    [FixerFileProcessedEvent::STATUS_INVALID],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 15],
-                ],
-                '...................E......EFFF.................................  63 / 189 ( 33%)'.PHP_EOL.
-                '.................S............................................. 126 / 189 ( 67%)'.PHP_EOL.
-                '....I.I........................................I............... 189 / 189 (100%)',
-                80,
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 19],
+                [FixerFileProcessedEvent::STATUS_EXCEPTION],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 6],
+                [FixerFileProcessedEvent::STATUS_LINT],
+                [FixerFileProcessedEvent::STATUS_FIXED, 3],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 50],
+                [FixerFileProcessedEvent::STATUS_SKIPPED],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 49],
+                [FixerFileProcessedEvent::STATUS_INVALID],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES],
+                [FixerFileProcessedEvent::STATUS_INVALID],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 40],
+                [FixerFileProcessedEvent::STATUS_INVALID],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 15],
             ],
+            '...................E......EFFF.................................  63 / 189 ( 33%)'.PHP_EOL.
+            '.................S............................................. 126 / 189 ( 67%)'.PHP_EOL.
+            '....I.I........................................I............... 189 / 189 (100%)',
+            80,
+        ];
+
+        yield [
             [
-                [
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 19],
-                    [FixerFileProcessedEvent::STATUS_EXCEPTION],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 6],
-                    [FixerFileProcessedEvent::STATUS_LINT],
-                    [FixerFileProcessedEvent::STATUS_FIXED, 3],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 50],
-                    [FixerFileProcessedEvent::STATUS_SKIPPED],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 49],
-                    [FixerFileProcessedEvent::STATUS_INVALID],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES],
-                    [FixerFileProcessedEvent::STATUS_INVALID],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 40],
-                    [FixerFileProcessedEvent::STATUS_INVALID],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 15],
-                ],
-                '...................E......EFFF.................................  63 / 189 ( 33%)'.PHP_EOL.
-                '.................S............................................. 126 / 189 ( 67%)'.PHP_EOL.
-                '....I.I........................................I............... 189 / 189 (100%)',
-                80,
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 19],
+                [FixerFileProcessedEvent::STATUS_EXCEPTION],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 6],
+                [FixerFileProcessedEvent::STATUS_LINT],
+                [FixerFileProcessedEvent::STATUS_FIXED, 3],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 50],
+                [FixerFileProcessedEvent::STATUS_SKIPPED],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 49],
+                [FixerFileProcessedEvent::STATUS_INVALID],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES],
+                [FixerFileProcessedEvent::STATUS_INVALID],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 40],
+                [FixerFileProcessedEvent::STATUS_INVALID],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 15],
             ],
+            '...................E......EFFF.................................  63 / 189 ( 33%)'.PHP_EOL.
+            '.................S............................................. 126 / 189 ( 67%)'.PHP_EOL.
+            '....I.I........................................I............... 189 / 189 (100%)',
+            80,
+        ];
+
+        yield [
             [
-                [
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 19],
-                    [FixerFileProcessedEvent::STATUS_EXCEPTION],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 6],
-                    [FixerFileProcessedEvent::STATUS_LINT],
-                    [FixerFileProcessedEvent::STATUS_FIXED, 3],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 50],
-                    [FixerFileProcessedEvent::STATUS_SKIPPED],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 49],
-                    [FixerFileProcessedEvent::STATUS_INVALID],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES],
-                    [FixerFileProcessedEvent::STATUS_INVALID],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 40],
-                    [FixerFileProcessedEvent::STATUS_INVALID],
-                    [FixerFileProcessedEvent::STATUS_NO_CHANGES, 15],
-                ],
-                '...................E......EFFF..................................................S...................... 103 / 189 ( 54%)'.PHP_EOL.
-                '...........................I.I........................................I...............                  189 / 189 (100%)',
-                120,
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 19],
+                [FixerFileProcessedEvent::STATUS_EXCEPTION],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 6],
+                [FixerFileProcessedEvent::STATUS_LINT],
+                [FixerFileProcessedEvent::STATUS_FIXED, 3],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 50],
+                [FixerFileProcessedEvent::STATUS_SKIPPED],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 49],
+                [FixerFileProcessedEvent::STATUS_INVALID],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES],
+                [FixerFileProcessedEvent::STATUS_INVALID],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 40],
+                [FixerFileProcessedEvent::STATUS_INVALID],
+                [FixerFileProcessedEvent::STATUS_NO_CHANGES, 15],
             ],
+            '...................E......EFFF..................................................S...................... 103 / 189 ( 54%)'.PHP_EOL.
+            '...........................I.I........................................I...............                  189 / 189 (100%)',
+            120,
         ];
     }
 

+ 100 - 97
tests/Console/Report/FixReport/AbstractReporterTestCase.php

@@ -64,26 +64,26 @@ abstract class AbstractReporterTestCase extends TestCase
 
     final public static function provideGenerateCases(): iterable
     {
-        return [
-            'no errors' => [
-                static::createNoErrorReport(),
-                new ReportSummary(
-                    [],
-                    10,
-                    0,
-                    0,
-                    false,
-                    false,
-                    false
-                ),
-            ],
-            'simple' => [
-                static::createSimpleReport(),
-                new ReportSummary(
-                    [
-                        'someFile.php' => [
-                            'appliedFixers' => ['some_fixer_name_here'],
-                            'diff' => '--- Original
+        yield 'no errors' => [
+            static::createNoErrorReport(),
+            new ReportSummary(
+                [],
+                10,
+                0,
+                0,
+                false,
+                false,
+                false
+            ),
+        ];
+
+        yield 'simple' => [
+            static::createSimpleReport(),
+            new ReportSummary(
+                [
+                    'someFile.php' => [
+                        'appliedFixers' => ['some_fixer_name_here'],
+                        'diff' => '--- Original
 +++ New
 @@ -2,7 +2,7 @@
 
@@ -94,23 +94,24 @@ abstract class AbstractReporterTestCase extends TestCase
      {
      }
  }',
-                        ],
                     ],
-                    10,
-                    0,
-                    0,
-                    false,
-                    false,
-                    false
-                ),
-            ],
-            'with diff' => [
-                static::createWithDiffReport(),
-                new ReportSummary(
-                    [
-                        'someFile.php' => [
-                            'appliedFixers' => ['some_fixer_name_here'],
-                            'diff' => '--- Original
+                ],
+                10,
+                0,
+                0,
+                false,
+                false,
+                false
+            ),
+        ];
+
+        yield 'with diff' => [
+            static::createWithDiffReport(),
+            new ReportSummary(
+                [
+                    'someFile.php' => [
+                        'appliedFixers' => ['some_fixer_name_here'],
+                        'diff' => '--- Original
 +++ New
 @@ -2,7 +2,7 @@
 
@@ -121,40 +122,42 @@ abstract class AbstractReporterTestCase extends TestCase
      {
      }
  }',
-                        ],
                     ],
-                    10,
-                    0,
-                    0,
-                    false,
-                    false,
-                    false
-                ),
-            ],
-            'with applied fixers' => [
-                static::createWithAppliedFixersReport(),
-                new ReportSummary(
-                    [
-                        'someFile.php' => [
-                            'appliedFixers' => ['some_fixer_name_here_1', 'some_fixer_name_here_2'],
-                            'diff' => '',
-                        ],
+                ],
+                10,
+                0,
+                0,
+                false,
+                false,
+                false
+            ),
+        ];
+
+        yield 'with applied fixers' => [
+            static::createWithAppliedFixersReport(),
+            new ReportSummary(
+                [
+                    'someFile.php' => [
+                        'appliedFixers' => ['some_fixer_name_here_1', 'some_fixer_name_here_2'],
+                        'diff' => '',
                     ],
-                    10,
-                    0,
-                    0,
-                    true,
-                    false,
-                    false
-                ),
-            ],
-            'with time and memory' => [
-                static::createWithTimeAndMemoryReport(),
-                new ReportSummary(
-                    [
-                        'someFile.php' => [
-                            'appliedFixers' => ['some_fixer_name_here'],
-                            'diff' => '--- Original
+                ],
+                10,
+                0,
+                0,
+                true,
+                false,
+                false
+            ),
+        ];
+
+        yield 'with time and memory' => [
+            static::createWithTimeAndMemoryReport(),
+            new ReportSummary(
+                [
+                    'someFile.php' => [
+                        'appliedFixers' => ['some_fixer_name_here'],
+                        'diff' => '--- Original
 +++ New
 @@ -2,7 +2,7 @@
 
@@ -165,37 +168,37 @@ abstract class AbstractReporterTestCase extends TestCase
      {
      }
  }',
-                        ],
                     ],
-                    10,
-                    1234,
-                    2621440, // 2.5 * 1024 * 1024
-                    false,
-                    false,
-                    false
-                ),
-            ],
-            'complex' => [
-                static::createComplexReport(),
-                new ReportSummary(
-                    [
-                        'someFile.php' => [
-                            'appliedFixers' => ['some_fixer_name_here_1', 'some_fixer_name_here_2'],
-                            'diff' => 'this text is a diff ;)',
-                        ],
-                        'anotherFile.php' => [
-                            'appliedFixers' => ['another_fixer_name_here'],
-                            'diff' => 'another diff here ;)',
-                        ],
+                ],
+                10,
+                1234,
+                2621440, // 2.5 * 1024 * 1024
+                false,
+                false,
+                false
+            ),
+        ];
+
+        yield 'complex' => [
+            static::createComplexReport(),
+            new ReportSummary(
+                [
+                    'someFile.php' => [
+                        'appliedFixers' => ['some_fixer_name_here_1', 'some_fixer_name_here_2'],
+                        'diff' => 'this text is a diff ;)',
+                    ],
+                    'anotherFile.php' => [
+                        'appliedFixers' => ['another_fixer_name_here'],
+                        'diff' => 'another diff here ;)',
                     ],
-                    10,
-                    1234,
-                    2621440, // 2.5 * 1024 * 1024
-                    true,
-                    true,
-                    true
-                ),
-            ],
+                ],
+                10,
+                1234,
+                2621440, // 2.5 * 1024 * 1024
+                true,
+                true,
+                true
+            ),
         ];
     }
 

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