From fe6ddfc2bffa85bd1f4c56e25a42dbc0b07273b2 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Thu, 12 Dec 2024 21:15:01 +0700 Subject: [PATCH] [DowngradePhp73] Handle heredoc new line stripped on multi rules --- .../DowngradeHeredoc/DowngradeHeredocTest.php | 28 +++++ .../DowngradeHeredoc/Fixture/fixture.php.inc | 105 ++++++++++++++++++ .../config/configured_rule.php | 10 ++ 3 files changed, 143 insertions(+) create mode 100644 tests/Issues/DowngradeHeredoc/DowngradeHeredocTest.php create mode 100644 tests/Issues/DowngradeHeredoc/Fixture/fixture.php.inc create mode 100644 tests/Issues/DowngradeHeredoc/config/configured_rule.php diff --git a/tests/Issues/DowngradeHeredoc/DowngradeHeredocTest.php b/tests/Issues/DowngradeHeredoc/DowngradeHeredocTest.php new file mode 100644 index 00000000..cf730d2a --- /dev/null +++ b/tests/Issues/DowngradeHeredoc/DowngradeHeredocTest.php @@ -0,0 +1,28 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFilesFromDirectory(__DIR__ . '/Fixture'); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config/configured_rule.php'; + } +} diff --git a/tests/Issues/DowngradeHeredoc/Fixture/fixture.php.inc b/tests/Issues/DowngradeHeredoc/Fixture/fixture.php.inc new file mode 100644 index 00000000..4ee39bda --- /dev/null +++ b/tests/Issues/DowngradeHeredoc/Fixture/fixture.php.inc @@ -0,0 +1,105 @@ + self::ORDER_CUSTOM, 'order' => ['A\B\Qux', 'A\B\Bar', 'A\B\Corge']], + ), + ], + ); + } +} + +?> +----- + self::ORDER_CUSTOM, 'order' => ['A\B\Qux', 'A\B\Bar', 'A\B\Corge']]), + ]); + } +} + +?> diff --git a/tests/Issues/DowngradeHeredoc/config/configured_rule.php b/tests/Issues/DowngradeHeredoc/config/configured_rule.php new file mode 100644 index 00000000..5550cffe --- /dev/null +++ b/tests/Issues/DowngradeHeredoc/config/configured_rule.php @@ -0,0 +1,10 @@ +sets([DowngradeLevelSetList::DOWN_TO_PHP_72]); +};