Code Duplication    Length = 6-6 lines in 2 locations

src/Xtools/AdminStats.php 1 location

@@ 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;

src/Xtools/ArticleInfo.php 1 location

@@ 1113-1118 (lines=6) @@
1110
1111
        // First sort editors array by the amount of text they added.
1112
        $topTenEditorsByAdded = $this->editors;
1113
        uasort($topTenEditorsByAdded, function ($a, $b) {
1114
            if ($a['added'] === $b['added']) {
1115
                return 0;
1116
            }
1117
            return $a['added'] > $b['added'] ? -1 : 1;
1118
        });
1119
1120
        // Then build a new array of top 10 editors by added text,
1121
        // in the data structure needed for the chart.