@@ -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 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function getUrl(bool $withTrailingSlash = true): string |
157 | 157 | { |
158 | - return rtrim($this->getBasicInfo()['url'], '/') . ($withTrailingSlash ? '/' : ''); |
|
158 | + return rtrim($this->getBasicInfo()['url'], '/').($withTrailingSlash ? '/' : ''); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | if ($page instanceof Page) { |
172 | 172 | $page = $page->getTitle($useUnnormalizedPageTitle); |
173 | 173 | } |
174 | - return str_replace('$1', $page, $this->getUrl(false) . $this->getArticlePath()); |
|
174 | + return str_replace('$1', $page, $this->getUrl(false).$this->getArticlePath()); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | public function getScript(): string |
208 | 208 | { |
209 | 209 | $metadata = $this->getMetadata(); |
210 | - return $metadata['general']['script'] ?? $this->getScriptPath() . '/index.php'; |
|
210 | + return $metadata['general']['script'] ?? $this->getScriptPath().'/index.php'; |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | */ |
217 | 217 | public function getApiUrl(): string |
218 | 218 | { |
219 | - return rtrim($this->getUrl(), '/') . $this->getRepository()->getApiPath(); |
|
219 | + return rtrim($this->getUrl(), '/').$this->getRepository()->getApiPath(); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | /** |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | */ |
292 | 292 | public function userOptInPage(User $user): string |
293 | 293 | { |
294 | - return 'User:' . $user->getUsername() . '/EditCounterOptIn.js'; |
|
294 | + return 'User:'.$user->getUsername().'/EditCounterOptIn.js'; |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | /** |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | } |
326 | 326 | |
327 | 327 | // 4. Lastly, see if they've opted in globally on the default project or Meta. |
328 | - $globalPageName = $user->getUsername() . '/EditCounterGlobalOptIn.js'; |
|
328 | + $globalPageName = $user->getUsername().'/EditCounterGlobalOptIn.js'; |
|
329 | 329 | $globalProject = $this->getRepository()->getGlobalProject(); |
330 | 330 | $globalExists = $globalProject->getRepository() |
331 | 331 | ->pageHasContent($globalProject, $userNsId, $globalPageName); |
@@ -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; |