@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace App\Model; |
6 | 6 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | User $user, |
113 | 113 | array $revs |
114 | 114 | ): array { |
115 | - return array_map(function ($rev) use ($pageRepo, $editRepo, $userRepo, $project, $user) { |
|
115 | + return array_map(function($rev) use ($pageRepo, $editRepo, $userRepo, $project, $user) { |
|
116 | 116 | /** Page object to be passed to the Edit constructor. */ |
117 | 117 | $page = Page::newFromRow($pageRepo, $project, $rev); |
118 | 118 | $rev['user'] = $user; |
@@ -358,8 +358,8 @@ discard block |
||
358 | 358 | // Must have underscores for the link to properly go to the section. |
359 | 359 | $sectionTitleLink = htmlspecialchars(str_replace(' ', '_', $sectionTitle)); |
360 | 360 | |
361 | - $sectionWikitext = "<a target='_blank' href='$pageUrl#$sectionTitleLink'>→</a>" . |
|
362 | - "<em class='text-muted'>" . htmlspecialchars($sectionTitle) . ":</em> "; |
|
361 | + $sectionWikitext = "<a target='_blank' href='$pageUrl#$sectionTitleLink'>→</a>". |
|
362 | + "<em class='text-muted'>".htmlspecialchars($sectionTitle).":</em> "; |
|
363 | 363 | $summary = str_replace($sectionMatch[0][0], $sectionWikitext, $summary); |
364 | 364 | } |
365 | 365 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | */ |
407 | 407 | public function getDiffUrl(): string |
408 | 408 | { |
409 | - return rtrim($this->getProject()->getUrlForPage('Special:Diff/' . $this->id), '/'); |
|
409 | + return rtrim($this->getProject()->getUrlForPage('Special:Diff/'.$this->id), '/'); |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | */ |
416 | 416 | public function getPermaUrl(): string |
417 | 417 | { |
418 | - return rtrim($this->getProject()->getUrlForPage('Special:PermaLink/' . $this->id), '/'); |
|
418 | + return rtrim($this->getProject()->getUrlForPage('Special:PermaLink/'.$this->id), '/'); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | /** |
@@ -494,10 +494,10 @@ discard block |
||
494 | 494 | $ret['reverted'] = $this->reverted; |
495 | 495 | } |
496 | 496 | if ($includeUsername) { |
497 | - $ret = [ 'username' => $this->getUser()->getUsername() ] + $ret; |
|
497 | + $ret = ['username' => $this->getUser()->getUsername()]+$ret; |
|
498 | 498 | } |
499 | 499 | if ($includeProject) { |
500 | - $ret = [ 'project' => $this->getProject()->getDomain() ] + $ret; |
|
500 | + $ret = ['project' => $this->getProject()->getDomain()]+$ret; |
|
501 | 501 | } |
502 | 502 | |
503 | 503 | return $ret; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace App\Helper; |
6 | 6 | |
@@ -80,14 +80,14 @@ discard block |
||
80 | 80 | return $this->cache->getItem($cacheKey)->get(); |
81 | 81 | } |
82 | 82 | |
83 | - $uri = 'https://meta.wikimedia.org/w/api.php?' . http_build_query([ |
|
83 | + $uri = 'https://meta.wikimedia.org/w/api.php?'.http_build_query([ |
|
84 | 84 | 'action' => 'query', |
85 | 85 | 'prop' => 'revisions', |
86 | 86 | 'rvprop' => 'content', |
87 | 87 | 'rvslots' => 'main', |
88 | 88 | 'format' => 'json', |
89 | 89 | 'formatversion' => 2, |
90 | - 'titles' => 'MediaWiki:XTools-AutoEdits.json' . ($useSandbox ? '/sandbox' : ''), |
|
90 | + 'titles' => 'MediaWiki:XTools-AutoEdits.json'.($useSandbox ? '/sandbox' : ''), |
|
91 | 91 | ]); |
92 | 92 | |
93 | 93 | if ($useSandbox && $this->session->get('logged_in_user')) { |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | |
152 | 152 | // Once last walk through for some tidying up and validation. |
153 | 153 | $invalid = []; |
154 | - array_walk($this->tools[$projectDomain], function (&$data, $tool) use (&$invalid): void { |
|
154 | + array_walk($this->tools[$projectDomain], function(&$data, $tool) use (&$invalid): void { |
|
155 | 155 | // Populate the 'label' with the tool name, if a label doesn't already exist. |
156 | 156 | $data['label'] = $data['label'] ?? $tool; |
157 | 157 | |
@@ -235,14 +235,14 @@ discard block |
||
235 | 235 | |
236 | 236 | $revertEntries = array_filter( |
237 | 237 | $this->getTools($project), |
238 | - function ($tool) { |
|
238 | + function($tool) { |
|
239 | 239 | return isset($tool['revert']) && isset($tool['regex']); |
240 | 240 | } |
241 | 241 | ); |
242 | 242 | |
243 | 243 | // If 'revert' is set to `true`, then use 'regex' as the regular expression, |
244 | 244 | // otherwise 'revert' is assumed to be the regex string. |
245 | - $this->revertTools[$projectDomain] = array_map(function ($revertTool) { |
|
245 | + $this->revertTools[$projectDomain] = array_map(function($revertTool) { |
|
246 | 246 | return [ |
247 | 247 | 'link' => $revertTool['link'], |
248 | 248 | 'regex' => true === $revertTool['revert'] ? $revertTool['regex'] : $revertTool['revert'], |