Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types = 1); |
||
35 | public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) |
||
36 | { |
||
37 | $tokens = $phpcsFile->getTokens(); |
||
38 | $token = $tokens[$stackPtr]; |
||
39 | |||
40 | $openParenthesis = $tokens[$token['scope_opener']]; |
||
41 | $closedParenthesis = $tokens[$token['scope_closer']]; |
||
42 | |||
43 | $length = $closedParenthesis['line'] - $openParenthesis['line']; |
||
44 | |||
45 | if ($length > $this->maxLength) { |
||
46 | $phpcsFile->addError("Class is {$length} lines. Must be {$this->maxLength} lines or fewer.", $stackPtr, __CLASS__); |
||
47 | } |
||
50 |