Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function getMostActiveTopic() |
||
19 | { |
||
20 | $commentsTopCount = 0; |
||
21 | $mostActiveTopic = null; |
||
22 | |||
23 | foreach ($this->data as $topic) { |
||
24 | if ($topic->getCommentsCount() > $commentsTopCount) { |
||
25 | $commentsTopCount = $topic->getCommentsCount(); |
||
26 | $mostActiveTopic = $topic; |
||
27 | } |
||
28 | } |
||
29 | |||
30 | return $mostActiveTopic; |
||
31 | } |
||
91 |