| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | private function formatSyntaxError(Issue $issue) |
||
| 40 | { |
||
| 41 | $filepath = $issue->getLocation()->getFilePath(); |
||
| 42 | $line = $issue->getLocation()->getLineStart(); |
||
| 43 | $codeLines = file($filepath); |
||
| 44 | |||
| 45 | $output = '<error>Syntax error: ' . $issue->getDescription() . " in {$filepath} </error>\n\n"; |
||
| 46 | |||
| 47 | $lineContent = trim($codeLines[$line-1]); |
||
| 48 | if (!empty($lineContent)) { |
||
| 49 | $output .= "<comment>\t {$lineContent} </comment>\n"; |
||
| 50 | } |
||
| 51 | |||
| 52 | return $output . "\n"; |
||
| 53 | } |
||
| 54 | |||
| 76 |