Passed
Pull Request — main (#455)
by MusikAnimal
09:06 queued 06:09
created
src/Repository/PageRepository.php 1 patch
Spacing   +7 added lines, -7 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
 
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
         $wikidataId = ltrim($page->getWikidataId(), 'Q');
303 303
 
304
-        $sql = "SELECT " . ($count ? 'COUNT(*) AS count' : '*') . "
304
+        $sql = "SELECT ".($count ? 'COUNT(*) AS count' : '*')."
305 305
                 FROM wikidatawiki_p.wb_items_per_site
306 306
                 WHERE ips_item_id = :wikidataId";
307 307
 
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
             'wikidataId' => $wikidataId,
310 310
         ])->fetchAllAssociative();
311 311
 
312
-        return $count ? (int) $result[0]['count'] : $result;
312
+        return $count ? (int)$result[0]['count'] : $result;
313 313
     }
314 314
 
315 315
     /**
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 
348 348
         // Transform to associative array by 'type'
349 349
         foreach ($res as $row) {
350
-            $data[$row['type'] . '_count'] = (int)$row['value'];
350
+            $data[$row['type'].'_count'] = (int)$row['value'];
351 351
         }
352 352
 
353 353
         return $data;
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
 
389 389
         $project = $page->getProject()->getDomain();
390 390
 
391
-        $url = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/' .
391
+        $url = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/'.
392 392
             "$project/all-access/user/$title/daily/$start/$end";
393 393
 
394 394
         $res = $this->guzzle->request('GET', $url);
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
     {
406 406
         if ($this->isWMF) {
407 407
             $domain = $page->getProject()->getDomain();
408
-            $url = "https://$domain/api/rest_v1/page/html/" . urlencode(str_replace(' ', '_', $page->getTitle()));
408
+            $url = "https://$domain/api/rest_v1/page/html/".urlencode(str_replace(' ', '_', $page->getTitle()));
409 409
             if (null !== $revId) {
410 410
                 $url .= "/$revId";
411 411
             }
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
             $normalized = [];
470 470
             if (isset($result['query']['normalized'])) {
471 471
                 array_map(
472
-                    function ($e) use (&$normalized): void {
472
+                    function($e) use (&$normalized): void {
473 473
                         $normalized[$e['to']] = $e['from'];
474 474
                     },
475 475
                     $result['query']['normalized']
Please login to merge, or discard this patch.
src/Exception/BadGatewayException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace App\Exception;
6 6
 
Please login to merge, or discard this patch.
src/Controller/ArticleInfoController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@
 block discarded – undo
264 264
     ): JsonResponse {
265 265
         $this->recordApiUsage('page/prose');
266 266
         $this->setupArticleInfo($articleInfoRepo, $autoEditsHelper);
267
-        $this->addFlash('info', 'The algorithm used by this API has recently changed. ' .
267
+        $this->addFlash('info', 'The algorithm used by this API has recently changed. '.
268 268
             'See https://www.mediawiki.org/wiki/XTools/Page_History#Prose for details.');
269 269
         $ret = $this->articleInfo->getProseStats();
270 270
         if (null === $ret) {
Please login to merge, or discard this patch.