Test Setup Failed
Push — symfony-upgrade ( 8f42b6...acd450 )
by MusikAnimal
05:33
created
src/Controller/XtoolsController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
             throw new XtoolsHttpException(
219 219
                 $this->i18n->msg('not-opted-in', [
220 220
                     $this->getOptedInPage()->getTitle(),
221
-                    $this->i18n->msg('not-opted-in-link') .
221
+                    $this->i18n->msg('not-opted-in-link').
222 222
                         ' <https://www.mediawiki.org/wiki/XTools/Edit_Counter#restricted_stats>',
223 223
                     $this->i18n->msg('not-opted-in-login'),
224 224
                 ]),
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
      * Set cookies on the given Response.
265 265
      * @param Response $response
266 266
      */
267
-    private function setCookies(Response &$response): void
267
+    private function setCookies(Response & $response): void
268 268
     {
269 269
         // Not done for subrequests.
270 270
         if ($this->isSubRequest) {
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
         $params = $this->convertLegacyParams($params);
665 665
 
666 666
         // Remove blank values.
667
-        return array_filter($params, function ($param) {
667
+        return array_filter($params, function($param) {
668 668
             // 'namespace' or 'username' could be '0'.
669 669
             return null !== $param && '' !== $param;
670 670
         });
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
         }
866 866
 
867 867
         $elapsedTime = round(
868
-            microtime(true) - $this->request->server->get('REQUEST_TIME_FLOAT'),
868
+            microtime(true)-$this->request->server->get('REQUEST_TIME_FLOAT'),
869 869
             3
870 870
         );
871 871
 
@@ -906,7 +906,7 @@  discard block
 block discarded – undo
906 906
     public function addFullPageTitlesAndContinue(string $key, array $out, array $data): array
907 907
     {
908 908
         // Add full_page_title (in addition to the existing page_title and page_namespace keys).
909
-        $out[$key] = array_map(function ($rev) {
909
+        $out[$key] = array_map(function($rev) {
910 910
             return array_merge([
911 911
                 'full_page_title' => $this->getPageFromNsAndTitle(
912 912
                     (int)$rev['page_namespace'],
@@ -942,7 +942,7 @@  discard block
 block discarded – undo
942 942
         $conn = $this->container->get('doctrine')
943 943
             ->getManager('default')
944 944
             ->getConnection();
945
-        $date =  date('Y-m-d');
945
+        $date = date('Y-m-d');
946 946
 
947 947
         // Increment count in timeline
948 948
         try {
Please login to merge, or discard this patch.
src/Repository/GlobalContribsRepository.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace App\Repository;
5 5
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             $slice = $this->getDbList()[$dbName];
175 175
             // actor_revision table only includes users who have made at least one edit.
176 176
             $actorTable = $this->getTableName($dbName, 'actor', 'revision');
177
-            $queriesBySlice[$slice][] = "SELECT '$dbName' AS `dbName`, actor_id " .
177
+            $queriesBySlice[$slice][] = "SELECT '$dbName' AS `dbName`, actor_id ".
178 178
                 "FROM $actorTable WHERE $whereClause";
179 179
         }
180 180
 
@@ -309,13 +309,13 @@  discard block
 block discarded – undo
309 309
         // Re-assemble into UNIONed queries, executing as many per slice as possible.
310 310
         $revisions = [];
311 311
         foreach ($queriesBySlice as $slice => $queries) {
312
-            $sql = "SELECT * FROM ((\n" . join("\n) UNION (\n", $queries) . ")) a ORDER BY timestamp DESC LIMIT $limit";
312
+            $sql = "SELECT * FROM ((\n".join("\n) UNION (\n", $queries).")) a ORDER BY timestamp DESC LIMIT $limit";
313 313
             $revisions = array_merge($revisions, $this->executeProjectsQuery($slice, $sql)->fetchAllAssociative());
314 314
         }
315 315
 
316 316
         // If there are more than $limit results, re-sort by timestamp.
317 317
         if (count($revisions) > $limit) {
318
-            usort($revisions, function ($a, $b) {
318
+            usort($revisions, function($a, $b) {
319 319
                 if ($a['unix_timestamp'] === $b['unix_timestamp']) {
320 320
                     return 0;
321 321
                 }
Please login to merge, or discard this patch.
src/Repository/EditCounterRepository.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * This file contains only the EditCounterRepository class.
4 4
  */
5 5
 
6
-declare(strict_types = 1);
6
+declare(strict_types=1);
7 7
 
8 8
 namespace App\Repository;
9 9
 
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
         ])->fetchAllAssociative();
141 141
 
142 142
         $logCounts = array_combine(
143
-            array_map(function ($e) {
143
+            array_map(function($e) {
144 144
                 return $e['source'];
145 145
             }, $results),
146
-            array_map(function ($e) {
146
+            array_map(function($e) {
147 147
                 return (int)$e['value'];
148 148
             }, $results)
149 149
         );
@@ -223,10 +223,10 @@  discard block
 block discarded – undo
223 223
         }
224 224
 
225 225
         $counts = array_combine(
226
-            array_map(function ($e) {
226
+            array_map(function($e) {
227 227
                 return $e['key'];
228 228
             }, $results),
229
-            array_map(function ($e) {
229
+            array_map(function($e) {
230 230
                 return (int)$e['val'];
231 231
             }, $results)
232 232
         );
@@ -408,9 +408,9 @@  discard block
 block discarded – undo
408 408
 
409 409
         $results = $this->executeProjectsQuery($project, $sql, $params)->fetchAll();
410 410
 
411
-        $namespaceTotals = array_combine(array_map(function ($e) {
411
+        $namespaceTotals = array_combine(array_map(function($e) {
412 412
             return $e['page_namespace'];
413
-        }, $results), array_map(function ($e) {
413
+        }, $results), array_map(function($e) {
414 414
             return (int)$e['total'];
415 415
         }, $results));
416 416
 
Please login to merge, or discard this patch.
src/Repository/PageRepository.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
  * This file contains only the PageRepository class.
4 4
  */
5 5
 
6
-declare(strict_types = 1);
6
+declare(strict_types=1);
7 7
 
8 8
 namespace App\Repository;
9 9
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 
306 306
         $wikidataId = ltrim($page->getWikidataId(), 'Q');
307 307
 
308
-        $sql = "SELECT " . ($count ? 'COUNT(*) AS count' : '*') . "
308
+        $sql = "SELECT ".($count ? 'COUNT(*) AS count' : '*')."
309 309
                 FROM wikidatawiki_p.wb_items_per_site
310 310
                 WHERE ips_item_id = :wikidataId";
311 311
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
             'wikidataId' => $wikidataId,
314 314
         ])->fetchAllAssociative();
315 315
 
316
-        return $count ? (int) $result[0]['count'] : $result;
316
+        return $count ? (int)$result[0]['count'] : $result;
317 317
     }
318 318
 
319 319
     /**
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 
352 352
         // Transform to associative array by 'type'
353 353
         foreach ($res as $row) {
354
-            $data[$row['type'] . '_count'] = (int)$row['value'];
354
+            $data[$row['type'].'_count'] = (int)$row['value'];
355 355
         }
356 356
 
357 357
         return $data;
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 
396 396
         $project = $page->getProject()->getDomain();
397 397
 
398
-        $url = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/' .
398
+        $url = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/'.
399 399
             "$project/all-access/user/$title/daily/$start/$end";
400 400
 
401 401
         $res = $client->request('GET', $url);
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
             $normalized = [];
472 472
             if (isset($result['query']['normalized'])) {
473 473
                 array_map(
474
-                    function ($e) use (&$normalized): void {
474
+                    function($e) use (&$normalized): void {
475 475
                         $normalized[$e['to']] = $e['from'];
476 476
                     },
477 477
                     $result['query']['normalized']
Please login to merge, or discard this patch.