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

@@ 1103-1108 (lines=6) @@
1100
1101
        // First sort editors array by the amount of text they added
1102
        $topTenEditorsByAdded = $this->editors;
1103
        uasort($topTenEditorsByAdded, function ($a, $b) {
1104
            if ($a['added'] === $b['added']) {
1105
                return 0;
1106
            }
1107
            return $a['added'] > $b['added'] ? -1 : 1;
1108
        });
1109
1110
        // Then build a new array of top 10 editors by added text,
1111
        //   in the data structure needed for the chart