diff --git a/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php b/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php index 29e184ec62..a9a0830f39 100644 --- a/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php +++ b/src/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php @@ -78,6 +78,7 @@ public function register() $targets[] = T_STATIC; $targets[] = T_READONLY; $targets[] = T_FINAL; + $targets[] = T_ABSTRACT; // Register function keywords to filter out param/return type declarations. $targets[] = T_FUNCTION; @@ -139,6 +140,7 @@ public function process(File $phpcsFile, $stackPtr) || $tokens[$stackPtr]['code'] === T_STATIC || $tokens[$stackPtr]['code'] === T_READONLY || $tokens[$stackPtr]['code'] === T_FINAL + || $tokens[$stackPtr]['code'] === T_ABSTRACT ) { $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 301f6efd4a..e31f86208f 100644 --- a/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc +++ b/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc @@ -172,3 +172,8 @@ class WithAsym { public protected(set) Type|NULL|bool $asym4 = TRUE; } + +abstract class SkipOverPHP84AbstractProperties { + abstract MyType|TRUE $propA {get;} + protected abstract NULL|MyClass $propB {set;} +} diff --git a/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed b/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed index 5dcd342dc9..bdb7e215ee 100644 --- a/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed +++ b/src/Standards/Generic/Tests/PHP/LowerCaseConstantUnitTest.1.inc.fixed @@ -172,3 +172,8 @@ class WithAsym { public protected(set) Type|NULL|bool $asym4 = true; } + +abstract class SkipOverPHP84AbstractProperties { + abstract MyType|TRUE $propA {get;} + protected abstract NULL|MyClass $propB {set;} +} diff --git a/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc b/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc index 4d0ca8ff57..9004e02454 100644 --- a/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc +++ b/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc @@ -113,3 +113,8 @@ class WithAsym { protected(set) false|string|null $asym3 = null; public protected(set) Type|null|bool $asym4 = true; } + +abstract class SkipOverPHP84AbstractProperties { + abstract MyType|true $propA {get;} + protected abstract null|MyClass $propB {set;} +} diff --git a/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed b/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed index 831f1161de..6fca3c63e0 100644 --- a/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed +++ b/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed @@ -113,3 +113,8 @@ class WithAsym { protected(set) false|string|null $asym3 = NULL; public protected(set) Type|null|bool $asym4 = TRUE; } + +abstract class SkipOverPHP84AbstractProperties { + abstract MyType|true $propA {get;} + protected abstract null|MyClass $propB {set;} +}