| @@ 157-162 (lines=6) @@ | ||
| 154 | $stats = $this->groupAdminStatsByUsername($stats, $abbreviateGroups); |
|
| 155 | ||
| 156 | // Resort, as for some reason the SQL isn't doing this properly. |
|
| 157 | uasort($stats, function ($a, $b) { |
|
| 158 | if ($a['total'] === $b['total']) { |
|
| 159 | return 0; |
|
| 160 | } |
|
| 161 | return ($a['total'] < $b['total']) ? 1 : -1; |
|
| 162 | }); |
|
| 163 | ||
| 164 | $this->adminStats = $stats; |
|
| 165 | return $this->adminStats; |
|
| @@ 1099-1104 (lines=6) @@ | ||
| 1096 | ||
| 1097 | // First sort editors array by the amount of text they added |
|
| 1098 | $topTenEditorsByAdded = $this->editors; |
|
| 1099 | uasort($topTenEditorsByAdded, function ($a, $b) { |
|
| 1100 | if ($a['added'] === $b['added']) { |
|
| 1101 | return 0; |
|
| 1102 | } |
|
| 1103 | return $a['added'] > $b['added'] ? -1 : 1; |
|
| 1104 | }); |
|
| 1105 | ||
| 1106 | // Then build a new array of top 10 editors by added text, |
|
| 1107 | // in the data structure needed for the chart |
|