Passed
Push — master ( b2abb4...75d7a7 )
by
unknown
11:23
created
src/AppBundle/Repository/AutoEditsRepository.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 AutoEditsRepository class.
4 4
  */
5 5
 
6
-declare(strict_types = 1);
6
+declare(strict_types=1);
7 7
 
8 8
 namespace AppBundle\Repository;
9 9
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
         if ('all' !== $namespace) {
38 38
             // Limit by namespace.
39
-            return array_filter($this->aeTools, function (array $tool) use ($namespace) {
39
+            return array_filter($this->aeTools, function(array $tool) use ($namespace) {
40 40
                 return empty($tool['namespaces']) ||
41 41
                     in_array((int)$namespace, $tool['namespaces']) ||
42 42
                     (
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             $tagJoin = "LEFT OUTER JOIN $tagTable ON ct_rev_id = rev_id";
92 92
             $condTools[] = "ct_tag_id IN ($tagIds)";
93 93
         }
94
-        $condTool = 'AND (' . implode(' OR ', $condTools) . ')';
94
+        $condTool = 'AND ('.implode(' OR ', $condTools).')';
95 95
 
96 96
         $sql = "SELECT COUNT(DISTINCT(rev_id))
97 97
                 FROM $revisionTable
@@ -311,8 +311,8 @@  discard block
 block discarded – undo
311 311
         }
312 312
 
313 313
         // Sort the array by count
314
-        uasort($results, function ($a, $b) {
315
-            return $b['count'] - $a['count'];
314
+        uasort($results, function($a, $b) {
315
+            return $b['count']-$a['count'];
316 316
         });
317 317
 
318 318
         // Cache and return.
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
             if (isset($values['tags'])) {
485 485
                 $tags = array_merge(
486 486
                     $tags,
487
-                    array_map(function ($tag) use ($conn) {
487
+                    array_map(function($tag) use ($conn) {
488 488
                         return $conn->quote($tag, \PDO::PARAM_STR);
489 489
                     }, $values['tags'])
490 490
                 );
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 
519 519
         if ($tagExcludes && 1 === count($tagIds)) {
520 520
             // Get tag IDs, filtering out those for which no ID exists (meaning there is no local tag for that tool).
521
-            $excludesList = implode(',', array_filter(array_map(function ($tagName) use ($project) {
521
+            $excludesList = implode(',', array_filter(array_map(function($tagName) use ($project) {
522 522
                 return $this->getTags($project)[$tagName] ?? null;
523 523
             }, $tagExcludes)));
524 524
 
Please login to merge, or discard this patch.
src/AppBundle/Repository/GlobalContribsRepository.php 1 patch
Spacing   +3 added lines, -3 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 AppBundle\Repository;
5 5
 
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         foreach ($dbNames as $dbName) {
164 164
             // actor_revision table only includes users who have made at least one edit.
165 165
             $actorTable = $this->getTableName($dbName, 'actor', 'revision');
166
-            $sqlParts []= "SELECT '$dbName' AS `dbName`, actor_id
166
+            $sqlParts [] = "SELECT '$dbName' AS `dbName`, actor_id
167 167
                            FROM $actorTable WHERE actor_name = :actor";
168 168
         }
169 169
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
                 $queries[] = $sql;
247 247
             }
248 248
         }
249
-        $sql = "SELECT * FROM ((\n" . join("\n) UNION (\n", $queries) . ")) a ORDER BY timestamp DESC LIMIT $limit";
249
+        $sql = "SELECT * FROM ((\n".join("\n) UNION (\n", $queries).")) a ORDER BY timestamp DESC LIMIT $limit";
250 250
 
251 251
         if (is_numeric($offset)) {
252 252
             $sql .= " OFFSET $offset";
Please login to merge, or discard this patch.
src/AppBundle/Model/Page.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 Page class.
4 4
  */
5 5
 
6
-declare(strict_types = 1);
6
+declare(strict_types=1);
7 7
 
8 8
 namespace AppBundle\Model;
9 9
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $title = $info['title'] ?? $this->unnormalizedPageName;
114 114
         $nsName = $this->getNamespaceName();
115 115
         return $nsName
116
-            ? str_replace($nsName . ':', '', $title)
116
+            ? str_replace($nsName.':', '', $title)
117 117
             : $title;
118 118
     }
119 119
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
     {
313 313
         $content = $this->getRepository()->getPagesWikitext(
314 314
             $this->getProject(),
315
-            [ $this->getTitle() ]
315
+            [$this->getTitle()]
316 316
         );
317 317
 
318 318
         return $content[$this->getTitle()] ?? null;
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 
379 379
         $wikidataInfo = $this->getRepository()->getWikidataInfo($this);
380 380
 
381
-        $terms = array_map(function ($entry) {
381
+        $terms = array_map(function($entry) {
382 382
             return $entry['term'];
383 383
         }, $wikidataInfo);
384 384
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
                 'prio' => 2,
390 390
                 'name' => 'Wikidata',
391 391
                 'notice' => "Label for language <em>$lang</em> is missing", // FIXME: i18n
392
-                'explanation' => "See: <a target='_blank' " .
392
+                'explanation' => "See: <a target='_blank' ".
393 393
                     "href='//www.wikidata.org/wiki/Help:Label'>Help:Label</a>",
394 394
             ];
395 395
         }
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                 'prio' => 3,
400 400
                 'name' => 'Wikidata',
401 401
                 'notice' => "Description for language <em>$lang</em> is missing", // FIXME: i18n
402
-                'explanation' => "See: <a target='_blank' " .
402
+                'explanation' => "See: <a target='_blank' ".
403 403
                     "href='//www.wikidata.org/wiki/Help:Description'>Help:Description</a>",
404 404
             ];
405 405
         }
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
             return 0;
478 478
         }
479 479
 
480
-        return array_sum(array_map(function ($item) {
480
+        return array_sum(array_map(function($item) {
481 481
             return (int)$item['views'];
482 482
         }, $pageviews['items']));
483 483
     }
Please login to merge, or discard this patch.
src/AppBundle/Helper/AutomatedEditsHelper.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 AutomatedEditsHelper class.
4 4
  */
5 5
 
6
-declare(strict_types = 1);
6
+declare(strict_types=1);
7 7
 
8 8
 namespace AppBundle\Helper;
9 9
 
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
         }
86 86
 
87 87
         $session = $this->container->get('session');
88
-        $uri = 'https://meta.wikimedia.org/w/index.php?action=raw&ctype=application/json&title=' .
89
-            'MediaWiki:XTools-AutoEdits.json' . ($useSandbox ? '/sandbox' : '');
88
+        $uri = 'https://meta.wikimedia.org/w/index.php?action=raw&ctype=application/json&title='.
89
+            'MediaWiki:XTools-AutoEdits.json'.($useSandbox ? '/sandbox' : '');
90 90
 
91 91
         if ($useSandbox && $session->get('logged_in_user')) {
92 92
             // Request via OAuth to get around server-side caching.
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
         // Once last walk through for some tidying up and validation.
151 151
         $invalid = [];
152
-        array_walk($this->tools[$projectDomain], function (&$data, $tool) use (&$invalid): void {
152
+        array_walk($this->tools[$projectDomain], function(&$data, $tool) use (&$invalid): void {
153 153
             // Populate the 'label' with the tool name, if a label doesn't already exist.
154 154
             $data['label'] = $data['label'] ?? $tool;
155 155
 
@@ -233,14 +233,14 @@  discard block
 block discarded – undo
233 233
 
234 234
         $revertEntries = array_filter(
235 235
             $this->getTools($project),
236
-            function ($tool) {
236
+            function($tool) {
237 237
                 return isset($tool['revert']) && isset($tool['regex']);
238 238
             }
239 239
         );
240 240
 
241 241
         // If 'revert' is set to `true`, then use 'regex' as the regular expression,
242 242
         //  otherwise 'revert' is assumed to be the regex string.
243
-        $this->revertTools[$projectDomain] = array_map(function ($revertTool) {
243
+        $this->revertTools[$projectDomain] = array_map(function($revertTool) {
244 244
             return [
245 245
                 'link' => $revertTool['link'],
246 246
                 'regex' => true === $revertTool['revert'] ? $revertTool['regex'] : $revertTool['revert'],
Please login to merge, or discard this patch.