@@ -39,12 +39,6 @@ public function register()
39
39
public function process (File $ phpcsFile , $ stackPtr )
40
40
{
41
41
$ 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
- }
48
42
49
43
if ($ this ->needValidateSpaces ($ phpcsFile , $ stackPtr , $ tokens )) {
50
44
$ this ->validateSpaces ($ phpcsFile , $ stackPtr , $ tokens );
@@ -95,6 +89,12 @@ private function validateSpaces(File $phpcsFile, $stackPtr, array $tokens)
95
89
$ phpcsFile ->addError ('There must be no space before a colon in a style definition ' , $ stackPtr , 'Before ' );
96
90
}
97
91
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
+
98
98
if (T_WHITESPACE !== $ tokens [($ stackPtr + 1 )]['code ' ]) {
99
99
$ phpcsFile ->addError ('Expected 1 space after colon in style definition; 0 found ' , $ stackPtr , 'NoneAfter ' );
100
100
} else {
0 commit comments