@@ -37,12 +37,12 @@ final class FunctionLengthSniff implements Sniff
37
37
/**
38
38
* @var true
39
39
*/
40
- public $ ignoreSingleLineComments = true ;
40
+ public $ ignoreComments = true ;
41
41
42
42
/**
43
43
* @var true
44
44
*/
45
- public $ ignoreWhiteLines = true ;
45
+ public $ ignoreBlankLines = true ;
46
46
47
47
/**
48
48
* @return int[]
@@ -65,8 +65,8 @@ public function process(File $file, $position)
65
65
66
66
$ ignored = [];
67
67
$ suffix = '' ;
68
- $ this ->ignoreWhiteLines and $ ignored [] = 'white lines ' ;
69
- $ this ->ignoreSingleLineComments and $ ignored [] = 'single line comments ' ;
68
+ $ this ->ignoreBlankLines and $ ignored [] = 'blank lines ' ;
69
+ $ this ->ignoreComments and $ ignored [] = 'single line comments ' ;
70
70
$ this ->ignoreDocBlocks and $ ignored [] = 'doc blocks ' ;
71
71
if ($ ignored ) {
72
72
$ suffix = ' (ignoring ' ;
@@ -126,7 +126,7 @@ private function collectLinesToExclude(
126
126
127
127
$ linesData = $ docblocks = [];
128
128
129
- $ skipLines = [$ tokens [$ start + 1 ]['line ' ], $ tokens [$ end - 1 ]['line ' ]];
129
+ $ skipLines = [$ tokens [$ start + 1 ]['line ' ], $ tokens [$ end ]['line ' ]];
130
130
for ($ i = $ start + 1 ; $ i < $ end - 1 ; $ i ++) {
131
131
if (in_array ($ tokens [$ i ]['line ' ], $ skipLines , true )) {
132
132
continue ;
@@ -140,10 +140,10 @@ private function collectLinesToExclude(
140
140
$ onlyComment = array_filter (array_column ($ linesData , 'only-comment ' ));
141
141
142
142
$ toExcludeCount = array_sum ($ docblocks );
143
- if ($ this ->ignoreWhiteLines ) {
143
+ if ($ this ->ignoreBlankLines ) {
144
144
$ toExcludeCount += count ($ empty );
145
145
}
146
- if ($ this ->ignoreSingleLineComments ) {
146
+ if ($ this ->ignoreComments ) {
147
147
$ toExcludeCount += count ($ onlyComment ) - count ($ empty );
148
148
}
149
149
0 commit comments