From 659bec325a833360a918cba5598829bb638ddc16 Mon Sep 17 00:00:00 2001 From: Greg Sherwood Date: Wed, 19 Feb 2020 08:00:05 +1100 Subject: [PATCH] Fixed bug #2850 : Generic.PHP.LowerCaseKeyword complains __HALT_COMPILER is uppercase --- package.xml | 1 + src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php | 1 - src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc | 1 + .../Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed | 1 + 4 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.xml b/package.xml index 877a77a637..57b9bee7cc 100644 --- a/package.xml +++ b/package.xml @@ -30,6 +30,7 @@ http://pear.php.net/dtd/package-2.0.xsd"> -- Thanks to Juliette Reinders Folmer for the patch - Fixed bug #2848 : PSR12.Files.FileHeader false positive for file with mixed PHP and HTML and no file header - Fixed bug #2849 : Generic.WhiteSpace.ScopeIndent false positive with arrow function inside array + - Fixed bug #2850 : Generic.PHP.LowerCaseKeyword complains __HALT_COMPILER is uppercase - Fixed bug #2853 : Undefined variable error when using Info report -- Thanks to Juliette Reinders Folmer for the patch diff --git a/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php b/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php index fc1d45212a..26522b9a2a 100644 --- a/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php +++ b/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php @@ -25,7 +25,6 @@ class LowerCaseKeywordSniff implements Sniff public function register() { return [ - T_HALT_COMPILER, T_ABSTRACT, T_ARRAY, T_AS, diff --git a/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc b/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc index a6406e2859..96c2062256 100644 --- a/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc +++ b/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc @@ -29,4 +29,5 @@ class X extends Y { } } FN ($x) => $x; +__HALT_COMPILER(); // An exception due to phar support. function diff --git a/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed b/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed index f97fe93da9..f7d3b397fe 100644 --- a/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed +++ b/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed @@ -29,4 +29,5 @@ class X extends Y { } } fn ($x) => $x; +__HALT_COMPILER(); // An exception due to phar support. function