* 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\FunctionNotation; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @author Gregor Harlan * * @internal * * @covers \PhpCsFixer\Fixer\FunctionNotation\UseArrowFunctionsFixer * * @extends AbstractFixerTestCase<\PhpCsFixer\Fixer\FunctionNotation\UseArrowFunctionsFixer> */ final class UseArrowFunctionsFixerTest extends AbstractFixerTestCase { /** * @dataProvider provideFixCases */ public function testFix(string $expected, ?string $input = null): void { $this->doTest($expected, $input); } /** * @return iterable */ public static function provideFixCases(): iterable { yield [ ' 1);', '$a);', ' 1 );', ' 1;', ' bar($a, $c), 2); EXPECTED, <<<'INPUT' 1); EXPECTED, <<<'INPUT' fn () => $a + 1); EXPECTED, <<<'INPUT' null;', ' null ;', ' null/* foo */;', '