From 8ab698b1e6cb994906f16faaf0d70b9771a924f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sat, 21 Oct 2023 13:10:38 +0200 Subject: [PATCH] Fix: Remove get_called_class and get_class options from functions option of function_to_constant fixer --- CHANGELOG.md | 4 ++++ src/RuleSet/Php53.php | 2 -- src/RuleSet/Php54.php | 2 -- test/Unit/RuleSet/Php53Test.php | 2 -- test/Unit/RuleSet/Php54Test.php | 2 -- 5 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 812cef59..a241009d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ For a full diff see [`6.8.1...main`][6.8.1...main]. - Configured `case` option of `elements` option of `class_attributes_separation` fixer ([#922]), by [@localheinz] +### Fixed + +- Removed `get_called_class` and `get_class` options from `functions` option of `function_to_constant` fixer where the resulting code would be incompatible with the target PHP version ([#923]), by [@localheinz] + ## [`6.8.1`][6.8.1] For a full diff see [`6.8.0...6.8.1`][6.8.0...6.8.1]. diff --git a/src/RuleSet/Php53.php b/src/RuleSet/Php53.php index dd65f9cb..924a6675 100644 --- a/src/RuleSet/Php53.php +++ b/src/RuleSet/Php53.php @@ -224,8 +224,6 @@ public static function create(): RuleSet ], 'function_to_constant' => [ 'functions' => [ - 'get_called_class', - 'get_class', 'php_sapi_name', 'phpversion', 'pi', diff --git a/src/RuleSet/Php54.php b/src/RuleSet/Php54.php index a1680773..5629d485 100644 --- a/src/RuleSet/Php54.php +++ b/src/RuleSet/Php54.php @@ -225,8 +225,6 @@ public static function create(): RuleSet ], 'function_to_constant' => [ 'functions' => [ - 'get_called_class', - 'get_class', 'php_sapi_name', 'phpversion', 'pi', diff --git a/test/Unit/RuleSet/Php53Test.php b/test/Unit/RuleSet/Php53Test.php index 2c86dc32..4857055c 100644 --- a/test/Unit/RuleSet/Php53Test.php +++ b/test/Unit/RuleSet/Php53Test.php @@ -246,8 +246,6 @@ protected function expectedRules(): Rules ], 'function_to_constant' => [ 'functions' => [ - 'get_called_class', - 'get_class', 'php_sapi_name', 'phpversion', 'pi', diff --git a/test/Unit/RuleSet/Php54Test.php b/test/Unit/RuleSet/Php54Test.php index 6dfbf7ad..f23b5cab 100644 --- a/test/Unit/RuleSet/Php54Test.php +++ b/test/Unit/RuleSet/Php54Test.php @@ -247,8 +247,6 @@ protected function expectedRules(): Rules ], 'function_to_constant' => [ 'functions' => [ - 'get_called_class', - 'get_class', 'php_sapi_name', 'phpversion', 'pi',