Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
38 | public function getTopTopic() |
||
39 | { |
||
40 | $topCount = 0; |
||
41 | $mostLikedTopic = null; |
||
42 | |||
43 | foreach ($this->data as $topic) { |
||
44 | if ($topic->getReactionsCount() > $topCount) { |
||
45 | $topCount = $topic->getReactionsCount(); |
||
46 | $mostLikedTopic = $topic; |
||
47 | } |
||
48 | } |
||
49 | |||
50 | return $mostLikedTopic; |
||
51 | } |
||
91 |