Skip to content

Commit ee9bd86

Browse files
committed
Rename config props for FunctionLengthSniff
1 parent 10d353a commit ee9bd86

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Inpsyde/Sniffs/CodeQuality/FunctionLengthSniff.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ final class FunctionLengthSniff implements Sniff
3737
/**
3838
* @var true
3939
*/
40-
public $ignoreSingleLineComments = true;
40+
public $ignoreComments = true;
4141

4242
/**
4343
* @var true
4444
*/
45-
public $ignoreWhiteLines = true;
45+
public $ignoreBlankLines = true;
4646

4747
/**
4848
* @return int[]
@@ -65,8 +65,8 @@ public function process(File $file, $position)
6565

6666
$ignored = [];
6767
$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';
7070
$this->ignoreDocBlocks and $ignored[] = 'doc blocks';
7171
if ($ignored) {
7272
$suffix = ' (ignoring ';
@@ -126,7 +126,7 @@ private function collectLinesToExclude(
126126

127127
$linesData = $docblocks = [];
128128

129-
$skipLines = [$tokens[$start + 1]['line'], $tokens[$end - 1]['line']];
129+
$skipLines = [$tokens[$start + 1]['line'], $tokens[$end]['line']];
130130
for ($i = $start + 1; $i < $end - 1; $i++) {
131131
if (in_array($tokens[$i]['line'], $skipLines, true)) {
132132
continue;
@@ -140,10 +140,10 @@ private function collectLinesToExclude(
140140
$onlyComment = array_filter(array_column($linesData, 'only-comment'));
141141

142142
$toExcludeCount = array_sum($docblocks);
143-
if ($this->ignoreWhiteLines) {
143+
if ($this->ignoreBlankLines) {
144144
$toExcludeCount += count($empty);
145145
}
146-
if ($this->ignoreSingleLineComments) {
146+
if ($this->ignoreComments) {
147147
$toExcludeCount += count($onlyComment) - count($empty);
148148
}
149149

0 commit comments

Comments
 (0)