| Conditions | 5 |
| Paths | 8 |
| Total Lines | 26 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 35 | public function process(FileInfo $file, Report $report) { |
||
| 36 | $tokens = $this->findTokens($file); |
||
| 37 | |||
| 38 | $lastInvalidToken = $this->getLastInvalidToken($file); |
||
| 39 | if (null !== $lastInvalidToken) { |
||
| 40 | $tokens->append($lastInvalidToken); |
||
| 41 | } |
||
| 42 | |||
| 43 | if ($tokens->count() === 0) { |
||
| 44 | return; |
||
| 45 | } |
||
| 46 | |||
| 47 | $lines = []; |
||
| 48 | foreach ($tokens as $token) { |
||
| 49 | $line = $token->getLine(); |
||
| 50 | $line++; # Our token start in previous line |
||
| 51 | if (isset($lines[$line])) { |
||
| 52 | continue; |
||
| 53 | } |
||
| 54 | |||
| 55 | $lines[$line] = true; |
||
| 56 | |||
| 57 | $report->addError($file, $this, 'File contains empty lines with spaces.', $line); |
||
| 58 | } |
||
| 59 | |||
| 60 | } |
||
| 61 | |||
| 62 | } |