* 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\ArrayNotation; use PhpCsFixer\Tests\Test\AbstractFixerTestCase; /** * @author Carlos Cirello * @author Dariusz Rumiński * @author Graham Campbell * * @internal * * @covers \PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer */ final class NoMultilineWhitespaceAroundDoubleArrowFixerTest extends AbstractFixerTestCase { /** * @dataProvider provideFixCases */ public function testFix(string $expected, ?string $input = null): void { $this->doTest($expected, $input); } public function provideFixCases(): array { return [ [ ' array(1), $a => array(0 => array()) );', ' array(1), $a => array(0 => array()) );', ], [ ' "b", "c" => "d", "eeeeee" => array(), "ggg" => array(), "hh" => [], );', ' "b", "c" => "d", "eeeeee" => array(), "ggg" => array(), "hh" => [], );', ], [ ' // hello there "value", "hi" => /* * Description. */1, "ha" => /** * Description. */ array() );', ], ]; } /** * @dataProvider provideFixPhp74Cases * @requires PHP 7.4 */ public function testFixPhp74(string $expected, ?string $input = null): void { $this->doTest($expected, $input); } public function provideFixPhp74Cases(): array { return [ [ ' null;', ' null;', ], ]; } }