@@ -3,7 +3,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -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 | |
@@ -163,7 +163,7 @@ discard block |
||
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 |
||
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"; |
@@ -3,7 +3,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -3,7 +3,7 @@ discard block |
||
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 | |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | $centralAuthProject = $this->container->getParameter('central_auth_project'); |
88 | 88 | $metaProject = ProjectRepository::getProject($centralAuthProject, $this->container); |
89 | 89 | |
90 | - $title = 'MediaWiki:XTools-AutoEdits.json' . ($useSandbox ? '/sandbox' : ''); |
|
90 | + $title = 'MediaWiki:XTools-AutoEdits.json'.($useSandbox ? '/sandbox' : ''); |
|
91 | 91 | $ret = json_decode(file_get_contents( |
92 | - $metaProject->getUrl() . "w/index.php?action=raw&ctype=application/json&title=$title" |
|
92 | + $metaProject->getUrl()."w/index.php?action=raw&ctype=application/json&title=$title" |
|
93 | 93 | ), true); |
94 | 94 | |
95 | 95 | if (!$useSandbox) { |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | ); |
139 | 139 | |
140 | 140 | // Finally, populate the 'label' with the tool name, if a label doesn't already exist. |
141 | - array_walk($this->tools[$projectDomain], function (&$data, $tool): void { |
|
141 | + array_walk($this->tools[$projectDomain], function(&$data, $tool): void { |
|
142 | 142 | $data['label'] = $data['label'] ?? $tool; |
143 | 143 | |
144 | 144 | // 'namespaces' should be an array of ints. |
@@ -212,14 +212,14 @@ discard block |
||
212 | 212 | |
213 | 213 | $revertEntries = array_filter( |
214 | 214 | $this->getTools($project), |
215 | - function ($tool) { |
|
215 | + function($tool) { |
|
216 | 216 | return isset($tool['revert']) && isset($tool['regex']); |
217 | 217 | } |
218 | 218 | ); |
219 | 219 | |
220 | 220 | // If 'revert' is set to `true`, then use 'regex' as the regular expression, |
221 | 221 | // otherwise 'revert' is assumed to be the regex string. |
222 | - $this->revertTools[$projectDomain] = array_map(function ($revertTool) { |
|
222 | + $this->revertTools[$projectDomain] = array_map(function($revertTool) { |
|
223 | 223 | return [ |
224 | 224 | 'link' => $revertTool['link'], |
225 | 225 | 'regex' => true === $revertTool['revert'] ? $revertTool['regex'] : $revertTool['revert'], |