@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace AppBundle\Repository; |
5 | 5 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $slice = $this->getDbList()[$dbName]; |
166 | 166 | // actor_revision table only includes users who have made at least one edit. |
167 | 167 | $actorTable = $this->getTableName($dbName, 'actor', 'revision'); |
168 | - $queriesBySlice[$slice][] = "SELECT '$dbName' AS `dbName`, actor_id " . |
|
168 | + $queriesBySlice[$slice][] = "SELECT '$dbName' AS `dbName`, actor_id ". |
|
169 | 169 | "FROM $actorTable WHERE actor_name = :actor"; |
170 | 170 | } |
171 | 171 | |
@@ -262,13 +262,13 @@ discard block |
||
262 | 262 | // Re-assemble into UNIONed queries, executing as many per slice as possible. |
263 | 263 | $revisions = []; |
264 | 264 | foreach ($queriesBySlice as $slice => $queries) { |
265 | - $sql = "SELECT * FROM ((\n" . join("\n) UNION (\n", $queries) . ")) a ORDER BY timestamp DESC LIMIT $limit"; |
|
265 | + $sql = "SELECT * FROM ((\n".join("\n) UNION (\n", $queries).")) a ORDER BY timestamp DESC LIMIT $limit"; |
|
266 | 266 | $revisions = array_merge($revisions, $this->executeProjectsQuery($slice, $sql)->fetchAll()); |
267 | 267 | } |
268 | 268 | |
269 | 269 | // If there are more than $limit results, re-sort by timestamp. |
270 | 270 | if (count($revisions) > $limit) { |
271 | - usort($revisions, function ($a, $b) { |
|
271 | + usort($revisions, function($a, $b) { |
|
272 | 272 | if ($a['unix_timestamp'] === $b['unix_timestamp']) { |
273 | 273 | return 0; |
274 | 274 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | namespace AppBundle\Model; |
5 | 5 | |
@@ -102,8 +102,8 @@ discard block |
||
102 | 102 | |
103 | 103 | if ($sorted) { |
104 | 104 | // Sort. |
105 | - uasort($this->globalEditCounts, function ($a, $b) { |
|
106 | - return $b['total'] - $a['total']; |
|
105 | + uasort($this->globalEditCounts, function($a, $b) { |
|
106 | + return $b['total']-$a['total']; |
|
107 | 107 | }); |
108 | 108 | } |
109 | 109 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $this->namespace, |
141 | 141 | $this->start, |
142 | 142 | $this->end, |
143 | - self::PAGE_SIZE + 1, |
|
143 | + self::PAGE_SIZE+1, |
|
144 | 144 | $this->offset |
145 | 145 | ); |
146 | 146 | $globalEdits = []; |