| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 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 | $classLength = $closedParenthesis['line'] - $openParenthesis['line']; |
||
| 44 | |||
| 45 | if ($classLength > $this->maxLength) { |
||
| 46 | $phpcsFile->addError("Class is {$classLength} lines. Must be {$this->maxLength} lines or fewer.", $stackPtr); |
||
| 47 | } |
||
| 48 | } |
||
| 49 | } |
||
| 50 |