@@ -39,12 +39,6 @@ public function register()
3939 public function process (File $ phpcsFile , $ stackPtr )
4040 {
4141 $ tokens = $ phpcsFile ->getTokens ();
42-
43- $ nextSemicolon = $ phpcsFile ->findNext (T_SEMICOLON , $ stackPtr );
44- if (false !== $ nextSemicolon && ($ tokens [$ nextSemicolon ]['line ' ] !== $ tokens [$ stackPtr ]['line ' ])) {
45- $ error = 'Expected 1 space after colon in style definition; newline found ' ;
46- $ phpcsFile ->addError ($ error , $ stackPtr , 'AfterNewline ' );
47- }
4842
4943 if ($ this ->needValidateSpaces ($ phpcsFile , $ stackPtr , $ tokens )) {
5044 $ this ->validateSpaces ($ phpcsFile , $ stackPtr , $ tokens );
@@ -95,6 +89,12 @@ private function validateSpaces(File $phpcsFile, $stackPtr, array $tokens)
9589 $ phpcsFile ->addError ('There must be no space before a colon in a style definition ' , $ stackPtr , 'Before ' );
9690 }
9791
92+ $ nextSemicolon = $ phpcsFile ->findNext (T_SEMICOLON , $ stackPtr );
93+ if (false !== $ nextSemicolon && ($ tokens [$ nextSemicolon ]['line ' ] !== $ tokens [$ stackPtr ]['line ' ])) {
94+ $ error = 'Expected 1 space after colon in style definition; newline found ' ;
95+ $ phpcsFile ->addError ($ error , $ stackPtr , 'AfterNewline ' );
96+ }
97+
9898 if (T_WHITESPACE !== $ tokens [($ stackPtr + 1 )]['code ' ]) {
9999 $ phpcsFile ->addError ('Expected 1 space after colon in style definition; 0 found ' , $ stackPtr , 'NoneAfter ' );
100100 } else {
0 commit comments