diff --git a/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php b/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php index bfd807e069..29e184ec62 100644 --- a/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php +++ b/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php @@ -77,6 +77,7 @@ public function register() $targets[] = T_VAR; $targets[] = T_STATIC; $targets[] = T_READONLY; + $targets[] = T_FINAL; // Register function keywords to filter out param/return type declarations. $targets[] = T_FUNCTION; @@ -137,6 +138,7 @@ public function process(File $phpcsFile, $stackPtr) || $tokens[$stackPtr]['code'] === T_VAR || $tokens[$stackPtr]['code'] === T_STATIC || $tokens[$stackPtr]['code'] === T_READONLY + || $tokens[$stackPtr]['code'] === T_FINAL ) { $skipOver = (Tokens::$emptyTokens + $this->propertyTypeTokens); $skipTo = $phpcsFile->findNext($skipOver, ($stackPtr + 1), null, true); diff --git a/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc b/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc index 98edc6a2f6..a6a75a7e87 100644 --- a/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc +++ b/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc @@ -155,3 +155,8 @@ const MYCONST = TRUE; class SkipOverPHP82DNFTypes { protected (\FullyQualified&Partially\Qualified)|TRUE $propertyC; } + +class SkipOverPHP84FinalProperties { + final MyType|FALSE $propA; + private static final NULL|MyClass $propB; +} diff --git a/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed b/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed index 1f14a2ce1a..2cc52294cd 100644 --- a/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed +++ b/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed @@ -155,3 +155,8 @@ const MYCONST = true; class SkipOverPHP82DNFTypes { protected (\FullyQualified&Partially\Qualified)|TRUE $propertyC; } + +class SkipOverPHP84FinalProperties { + final MyType|FALSE $propA; + private static final NULL|MyClass $propB; +} diff --git a/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc b/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc index 9d65a18258..7d81893c66 100644 --- a/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc +++ b/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc @@ -100,3 +100,8 @@ $cl = function (int|false $param = null, Type|null $obj = new MyObj(false)) : st class SkipOverPHP82DNFTypes { protected (\FullyQualified&Partially\Qualified)|false $propertyC; } + +class SkipOverPHP84FinalProperties { + final MyType|false $propA; + private static final null|MyClass $propB; +} diff --git a/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed b/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed index d61e3c235e..26e20f290e 100644 --- a/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed +++ b/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed @@ -100,3 +100,8 @@ $cl = function (int|false $param = NULL, Type|null $obj = new MyObj(FALSE)) : st class SkipOverPHP82DNFTypes { protected (\FullyQualified&Partially\Qualified)|false $propertyC; } + +class SkipOverPHP84FinalProperties { + final MyType|false $propA; + private static final null|MyClass $propB; +}