Conditions | 3 |
Paths | 3 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
55 | private function formatNotice(Issue $issue) |
||
56 | { |
||
57 | $filepath = $issue->getLocation()->getFilePath(); |
||
58 | $line = $issue->getLocation()->getLineStart(); |
||
59 | $codeLines = file($filepath); |
||
60 | |||
61 | $output = '<comment>Notice: ' . $issue->getDescription() . " in {$filepath} on {$line} [{$issue->getCheckName()}]</comment>\n\n"; |
||
62 | |||
63 | if ($issue->getBlame()) { |
||
64 | $output .= "<comment>\t {$issue->getBlame()}</comment>\n"; |
||
65 | } else { |
||
66 | $code = trim($codeLines[$line - 1]); |
||
67 | |||
68 | if (!empty($code)) { |
||
69 | $output .= "<comment>\t {$code} </comment>\n"; |
||
70 | } |
||
71 | } |
||
72 | |||
73 | return $output . "\n"; |
||
74 | } |
||
75 | } |
||
76 |