Conditions | 5 |
Paths | 5 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | private function diff($row, $nbGame): string |
||
16 | { |
||
17 | if ($row['oldRank'] != null) { |
||
18 | if ($row['rank'] < $row['oldRank']) { |
||
19 | if ($row['oldRank'] > $nbGame) { |
||
20 | $col = '<span class="article-top--new"><abbr title="New">N</abbr></span>'; |
||
21 | } else { |
||
22 | $col = sprintf('<span class="article-top--up">+%d <span class="screen-reader-text">position</span></span>', $row['oldRank'] - $row['rank']); |
||
23 | } |
||
24 | } elseif ($row['rank'] > $row['oldRank']) { |
||
25 | $col = sprintf('<span class="article-top--down">-%d <span class="screen-reader-text">position</span></span>', $row['rank'] - $row['oldRank']); |
||
26 | } else { |
||
27 | $col = '<span class="article-top--equal"><abbr title="Same position">=</abbr></span>'; |
||
28 | } |
||
29 | } else { |
||
30 | $col = '<span class="article-top--new"><abbr title="New">N</abbr></span>'; |
||
31 | } |
||
32 | return $col; |
||
33 | } |
||
80 |