| Conditions | 4 |
| Paths | 5 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function renderNote(Note $note) |
||
| 25 | { |
||
| 26 | $str = $this->renderNoteHead($note); |
||
| 27 | if (!$str) { |
||
| 28 | return; |
||
| 29 | } |
||
| 30 | $authors = []; |
||
| 31 | foreach ($note->getCommits() as $commit) { |
||
| 32 | $authors[$commit->getAuthor()] = '[' . $commit->getAuthor() . ']'; |
||
| 33 | } |
||
| 34 | if ($authors) { |
||
|
|
|||
| 35 | $str .= ' (' . implode(', ', $authors) . ')'; |
||
| 36 | } |
||
| 37 | |||
| 38 | return $str; |
||
| 39 | } |
||
| 40 | } |
||
| 41 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.