Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
24 | 2 | public function getFlashMessages(){ |
|
25 | 2 | $messages = $_SESSION['flashmessages']; |
|
26 | 2 | $html = null; |
|
27 | 2 | if($messages) { |
|
28 | 1 | foreach ($messages as $key => $message) { |
|
29 | 1 | $html .= "<div class='" . $message['type'] . "'><p>" . $message['content'] . "</p></div>"; |
|
30 | 1 | } |
|
31 | 1 | } else { |
|
32 | 1 | $html = null; |
|
33 | } |
||
34 | 2 | return $html; |
|
35 | |||
36 | } |
||
37 | |||
38 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.