@@ -27,15 +27,15 @@ public function register()
27
27
}
28
28
29
29
/**
30
- * Copied from \Generic_Sniffs_Files_LineLengthSniff
30
+ * Copied from \Generic_Sniffs_Files_LineLengthSniff, minor changes made
31
31
*
32
32
* {@inheritDoc}
33
33
*/
34
34
public function process (\PHP_CodeSniffer_File $ phpcsFile , $ stackPtr )
35
35
{
36
36
$ tokens = $ phpcsFile ->getTokens ();
37
37
38
- // Make sure this is the first open tag.
38
+ // Make sure this is the first open tag
39
39
$ previousOpenTag = $ phpcsFile ->findPrevious (T_OPEN_TAG , ($ stackPtr - 1 ));
40
40
if ($ previousOpenTag !== false ) {
41
41
return ;
@@ -45,19 +45,16 @@ public function process(\PHP_CodeSniffer_File $phpcsFile, $stackPtr)
45
45
$ currentLineContent = '' ;
46
46
$ currentLine = 1 ;
47
47
48
- $ trim = (strlen ($ phpcsFile ->eolChar ) * -1 );
49
48
for (; $ tokenCount < $ phpcsFile ->numTokens ; $ tokenCount ++) {
50
49
if ($ tokens [$ tokenCount ]['line ' ] === $ currentLine ) {
51
50
$ currentLineContent .= $ tokens [$ tokenCount ]['content ' ];
52
51
} else {
53
- $ currentLineContent = substr ($ currentLineContent , 0 , $ trim );
54
52
$ this ->checkIfFirstArgumentConstant ($ phpcsFile , ($ tokenCount - 1 ), $ currentLineContent );
55
53
$ currentLineContent = $ tokens [$ tokenCount ]['content ' ];
56
54
$ currentLine ++;
57
55
}
58
56
}
59
57
60
- $ currentLineContent = substr ($ currentLineContent , 0 , $ trim );
61
58
$ this ->checkIfFirstArgumentConstant ($ phpcsFile , ($ tokenCount - 1 ), $ currentLineContent );
62
59
}
63
60
0 commit comments