Passed
Pull Request — main (#460)
by MusikAnimal
09:09 queued 06:05
created
src/Controller/ArticleInfoController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -267,7 +267,7 @@
 block discarded – undo
267 267
         $responseCode = Response::HTTP_OK;
268 268
         $this->recordApiUsage('page/prose');
269 269
         $this->setupArticleInfo($articleInfoRepo, $autoEditsHelper);
270
-        $this->addFlash('info', 'The algorithm used by this API has recently changed. ' .
270
+        $this->addFlash('info', 'The algorithm used by this API has recently changed. '.
271 271
             'See https://www.mediawiki.org/wiki/XTools/Page_History#Prose for details.');
272 272
         $ret = $this->articleInfo->getProseStats();
273 273
         if (null === $ret) {
Please login to merge, or discard this patch.
src/Repository/AuthorshipRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace App\Repository;
6 6
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 
48 48
         try {
49 49
             $res = $this->guzzle->request('GET', $url, $opts);
50
-        } catch (ServerException|ConnectException $e) {
50
+        } catch (ServerException | ConnectException $e) {
51 51
             throw new BadGatewayException('api-error-wikimedia', ['WikiWho'], $e);
52 52
         }
53 53
 
Please login to merge, or discard this patch.
src/Repository/PageRepository.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace App\Repository;
6 6
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 
309 309
         $wikidataId = ltrim($page->getWikidataId(), 'Q');
310 310
 
311
-        $sql = "SELECT " . ($count ? 'COUNT(*) AS count' : '*') . "
311
+        $sql = "SELECT ".($count ? 'COUNT(*) AS count' : '*')."
312 312
                 FROM wikidatawiki_p.wb_items_per_site
313 313
                 WHERE ips_item_id = :wikidataId";
314 314
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
             'wikidataId' => $wikidataId,
317 317
         ])->fetchAllAssociative();
318 318
 
319
-        return $count ? (int) $result[0]['count'] : $result;
319
+        return $count ? (int)$result[0]['count'] : $result;
320 320
     }
321 321
 
322 322
     /**
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
 
355 355
         // Transform to associative array by 'type'
356 356
         foreach ($res as $row) {
357
-            $data[$row['type'] . '_count'] = (int)$row['value'];
357
+            $data[$row['type'].'_count'] = (int)$row['value'];
358 358
         }
359 359
 
360 360
         return $data;
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
 
406 406
         $project = $page->getProject()->getDomain();
407 407
 
408
-        $url = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/' .
408
+        $url = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/'.
409 409
             "$project/all-access/user/$title/daily/$start/$end";
410 410
 
411 411
         try {
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
             ]);
416 416
             $pageviews = json_decode($res->getBody()->getContents(), true);
417 417
             return $pageviews;
418
-        } catch (ServerException|ConnectException $e) {
418
+        } catch (ServerException | ConnectException $e) {
419 419
             throw new BadGatewayException('api-error-wikimedia', ['Pageviews'], $e);
420 420
         }
421 421
     }
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
     {
431 431
         if ($this->isWMF) {
432 432
             $domain = $page->getProject()->getDomain();
433
-            $url = "https://$domain/api/rest_v1/page/html/" . urlencode(str_replace(' ', '_', $page->getTitle()));
433
+            $url = "https://$domain/api/rest_v1/page/html/".urlencode(str_replace(' ', '_', $page->getTitle()));
434 434
             if (null !== $revId) {
435 435
                 $url .= "/$revId";
436 436
             }
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
             return $this->guzzle->request('GET', $url)
446 446
                 ->getBody()
447 447
                 ->getContents();
448
-        } catch (ServerException|ClientException $e) {
448
+        } catch (ServerException | ClientException $e) {
449 449
             if ($e instanceof ClientException && $page->exists() && Response::HTTP_NOT_FOUND === $e->getCode()) {
450 450
                 // Sometimes the REST API throws 404s when the page does in fact exist.
451 451
                 throw new BadGatewayException('api-error-wikimedia', ['Wikimedia REST'], $e);
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
             $normalized = [];
503 503
             if (isset($result['query']['normalized'])) {
504 504
                 array_map(
505
-                    function ($e) use (&$normalized): void {
505
+                    function($e) use (&$normalized): void {
506 506
                         $normalized[$e['to']] = $e['from'];
507 507
                     },
508 508
                     $result['query']['normalized']
Please login to merge, or discard this patch.