Conditions | 3 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
57 | protected function formatContentSection($daysBack, $data) |
||
58 | { |
||
59 | if($daysBack > 1000) { |
||
60 | $html = '<h4 style="padding-top: 30px; clear: both;">From the beginning of time:</h4>'; |
||
61 | } else { |
||
62 | $html = '<h4>Last '.$daysBack.' days:</h4>'; |
||
63 | } |
||
64 | $html .= '<dl>'; |
||
65 | foreach($data['Totals'] as $name => $count) { |
||
66 | $percentage = round($count / $data['Total'], 2) * 100; |
||
67 | $html .= ' |
||
68 | <dt>'.$name.'</dt> |
||
69 | <dd>'.$count.' × = '.$percentage.'%</dd>'; |
||
70 | } |
||
71 | |||
72 | return $html; |
||
73 | } |
||
74 | |||
76 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.