* Dariusz RumiƄski * * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ namespace PhpCsFixer\Tests\Fixer\Whitespace; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @internal * * @covers \PhpCsFixer\Fixer\Whitespace\TypesSpacesFixer * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\Whitespace\TypesSpacesFixer> * * @phpstan-import-type _AutogeneratedInputConfiguration from \PhpCsFixer\Fixer\Whitespace\TypesSpacesFixer */ final class TypesSpacesFixerTest extends AbstractFixerTestCase { /** * @param _AutogeneratedInputConfiguration $configuration * * @dataProvider provideFixCases */ public function testFix(string $expected, ?string $input = null, array $configuration = []): void { $this->fixer->configure($configuration); $this->doTest($expected, $input); } public static function provideFixCases(): iterable { yield [ ' 'single'], ]; yield [ ' 'single'], ]; yield [ ' 'single'], ]; } /** * @param _AutogeneratedInputConfiguration $configuration * * @dataProvider provideFix80Cases * * @requires PHP 8.0 */ public function testFix80(string $expected, ?string $input = null, array $configuration = []): void { $this->fixer->configure($configuration); $this->doTest($expected, $input); } public static function provideFix80Cases(): iterable { yield [ ' 'single'], ]; yield [ ' 'single'], ]; yield [ ' 'single'], ]; yield [ ' 'single', 'space_multiple_catch' => 'none', ], ]; yield [ ' 'none', 'space_multiple_catch' => 'single', ], ]; yield [ ' 'none', 'space_multiple_catch' => 'none', ], ]; yield [ ' 'single', 'space_multiple_catch' => 'single', ], ]; yield [ ' 'single', ], ]; yield [ ' 'none', ], ]; } /** * @dataProvider provideFix81Cases * * @requires PHP 8.1 */ public function testFix81(string $expected, string $input): void { $this->doTest($expected, $input); } /** * @return iterable */ public static function provideFix81Cases(): iterable { yield [ '