1515use const T_COMMENT ;
1616use const T_CONST ;
1717use const T_DOC_COMMENT_OPEN_TAG ;
18+ use const T_ENUM_CASE ;
1819use const T_FUNCTION ;
1920use const T_PRIVATE ;
2021use const T_PROTECTED ;
2930/**
3031 * @internal
3132 */
32- abstract class AbstractPropertyAndConstantSpacing implements Sniff
33+ abstract class AbstractPropertyConstantAndEnumCaseSpacing implements Sniff
3334{
3435
3536 /** @var int */
@@ -69,7 +70,11 @@ public function process(File $phpcsFile, $pointer): int
6970 $ firstOnLinePointer = TokenHelper::findFirstTokenOnNextLine ($ phpcsFile , $ semicolonPointer );
7071 assert ($ firstOnLinePointer !== null );
7172
72- $ nextFunctionPointer = TokenHelper::findNext ($ phpcsFile , [T_FUNCTION , T_CONST , T_VARIABLE , T_USE ], $ firstOnLinePointer + 1 );
73+ $ nextFunctionPointer = TokenHelper::findNext (
74+ $ phpcsFile ,
75+ [T_FUNCTION , T_ENUM_CASE , T_CONST , T_VARIABLE , T_USE ],
76+ $ firstOnLinePointer + 1
77+ );
7378 if (
7479 $ nextFunctionPointer === null
7580 || $ tokens [$ nextFunctionPointer ]['code ' ] === T_FUNCTION
@@ -78,7 +83,7 @@ public function process(File $phpcsFile, $pointer): int
7883 return $ nextFunctionPointer ?? $ firstOnLinePointer ;
7984 }
8085
81- $ types = [T_COMMENT , T_DOC_COMMENT_OPEN_TAG , T_ATTRIBUTE , T_CONST , T_VAR , T_PUBLIC , T_PROTECTED , T_PRIVATE , T_READONLY , T_STATIC , T_USE ];
86+ $ types = [T_COMMENT , T_DOC_COMMENT_OPEN_TAG , T_ATTRIBUTE , T_ENUM_CASE , T_CONST , T_VAR , T_PUBLIC , T_PROTECTED , T_PRIVATE , T_READONLY , T_STATIC , T_USE ];
8287 $ nextPointer = TokenHelper::findNext ($ phpcsFile , $ types , $ firstOnLinePointer + 1 , $ tokens [$ classPointer ]['scope_closer ' ]);
8388
8489 if (!$ this ->isNextMemberValid ($ phpcsFile , $ nextPointer )) {
0 commit comments