@@ -10,12 +10,8 @@ class MemberVarSpacingSniff extends \PHP_CodeSniffer\Sniffs\AbstractVariableSnif
1010 public int $ spacingBeforeFirst = 1 ;
1111 public bool $ ignoreFirstMemberVar = false ;
1212
13- /**
14- * @return int|void
15- */
1613 //@phpcs:ignore Squiz.Commenting.FunctionComment.ScalarTypeHintMissing
17- //@phpcs:ignore SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint
18- protected function processMemberVar (\PHP_CodeSniffer \Files \File $ phpcsFile , $ stackPtr )
14+ protected function processMemberVar (\PHP_CodeSniffer \Files \File $ phpcsFile , $ stackPtr ) : ?int
1915 {
2016 $ tokens = $ phpcsFile ->getTokens ();
2117
@@ -25,7 +21,7 @@ protected function processMemberVar(\PHP_CodeSniffer\Files\File $phpcsFile, $sta
2521 $ startOfStatement = $ phpcsFile ->findPrevious ($ validPrefixes , $ stackPtr - 1 , null , false , null , true );
2622
2723 if ($ startOfStatement === false ) {
28- return ;
24+ return null ;
2925 }
3026
3127 $ endOfStatement = $ phpcsFile ->findNext (\T_SEMICOLON , $ stackPtr + 1 , null , false , null , true );
@@ -97,13 +93,13 @@ protected function processMemberVar(\PHP_CodeSniffer\Files\File $phpcsFile, $sta
9793 && isset ($ tokens [$ prev ]['scope_condition ' ]) === true
9894 && $ tokens [$ tokens [$ prev ]['scope_condition ' ]]['code ' ] === \T_FUNCTION
9995 ) {
100- return ;
96+ return null ;
10197 }
10298
10399 $ prevVar = $ phpcsFile ->findPrevious (\T_VARIABLE , $ first - 1 );
104100
105101 if ($ this ->ignoreFirstMemberVar && $ tokens [$ prevVar ]['code ' ] !== \T_VARIABLE ) {
106- return ;
102+ return null ;
107103 }
108104
109105 if ($ tokens [$ prev ]['code ' ] === \T_OPEN_CURLY_BRACKET
@@ -131,7 +127,7 @@ protected function processMemberVar(\PHP_CodeSniffer\Files\File $phpcsFile, $sta
131127 return $ endOfStatement ;
132128 }
133129
134- return ;
130+ return null ;
135131 }
136132
137133 $ data = [
0 commit comments