| Conditions | 4 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | public function getMessage() |
||
| 34 | { |
||
| 35 | $html = null; |
||
| 36 | // Print messages |
||
| 37 | if ($this->message && $this->message !== '') { |
||
| 38 | $html = '<div id="messagebox">'; |
||
| 39 | foreach ($this->message as $msg) |
||
| 40 | { |
||
| 41 | $html .= ' |
||
| 42 | <div class="message '.htmlentities($msg["type"]).'"> |
||
| 43 | <p>'.htmlentities($msg["msg"]).'</p> |
||
| 44 | </div>'; |
||
| 45 | } |
||
| 46 | $html .= '</div>'; |
||
| 47 | } |
||
| 48 | return $html; |
||
| 49 | } |
||
| 50 | } |
||
| 51 |
Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable: