@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the Edit class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Model; |
| 9 | 9 | |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | $isSection = preg_match_all("/^\/\* (.*?) \*\//", $summary, $sectionMatch); |
| 277 | 277 | |
| 278 | 278 | if ($isSection && isset($page)) { |
| 279 | - $pageUrl = $project->getUrl(false) . str_replace( |
|
| 279 | + $pageUrl = $project->getUrl(false).str_replace( |
|
| 280 | 280 | '$1', |
| 281 | 281 | $page->getTitle($useUnnormalizedPageTitle), |
| 282 | 282 | $project->getArticlePath() |
@@ -286,8 +286,8 @@ discard block |
||
| 286 | 286 | // Must have underscores for the link to properly go to the section. |
| 287 | 287 | $sectionTitleLink = htmlspecialchars(str_replace(' ', '_', $sectionTitle)); |
| 288 | 288 | |
| 289 | - $sectionWikitext = "<a target='_blank' href='$pageUrl#$sectionTitleLink'>→</a>" . |
|
| 290 | - "<em class='text-muted'>" . htmlspecialchars($sectionTitle) . ":</em> "; |
|
| 289 | + $sectionWikitext = "<a target='_blank' href='$pageUrl#$sectionTitleLink'>→</a>". |
|
| 290 | + "<em class='text-muted'>".htmlspecialchars($sectionTitle).":</em> "; |
|
| 291 | 291 | $summary = str_replace($sectionMatch[0][0], $sectionWikitext, $summary); |
| 292 | 292 | } |
| 293 | 293 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | ); |
| 302 | 302 | |
| 303 | 303 | // Use normalized page title (underscored, capitalized). |
| 304 | - $pageUrl = $project->getUrl(false) . str_replace( |
|
| 304 | + $pageUrl = $project->getUrl(false).str_replace( |
|
| 305 | 305 | '$1', |
| 306 | 306 | ucfirst(str_replace(' ', '_', $wikiLinkPath)), |
| 307 | 307 | $project->getArticlePath() |
@@ -339,8 +339,8 @@ discard block |
||
| 339 | 339 | public function getDiffUrl(): string |
| 340 | 340 | { |
| 341 | 341 | $project = $this->getProject(); |
| 342 | - $path = str_replace('$1', 'Special:Diff/' . $this->id, $project->getArticlePath()); |
|
| 343 | - return rtrim($project->getUrl(), '/') . $path; |
|
| 342 | + $path = str_replace('$1', 'Special:Diff/'.$this->id, $project->getArticlePath()); |
|
| 343 | + return rtrim($project->getUrl(), '/').$path; |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | /** |
@@ -350,8 +350,8 @@ discard block |
||
| 350 | 350 | public function getPermaUrl(): string |
| 351 | 351 | { |
| 352 | 352 | $project = $this->getProject(); |
| 353 | - $path = str_replace('$1', 'Special:PermaLink/' . $this->id, $project->getArticlePath()); |
|
| 354 | - return rtrim($project->getUrl(), '/') . $path; |
|
| 353 | + $path = str_replace('$1', 'Special:PermaLink/'.$this->id, $project->getArticlePath()); |
|
| 354 | + return rtrim($project->getUrl(), '/').$path; |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | /** |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the TopEdits class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Model; |
| 9 | 9 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | { |
| 140 | 140 | $firstDateTime = $this->topEdits[0]->getTimestamp(); |
| 141 | 141 | $lastDateTime = end($this->topEdits)->getTimestamp(); |
| 142 | - $secs = $firstDateTime->getTimestamp() - $lastDateTime->getTimestamp(); |
|
| 142 | + $secs = $firstDateTime->getTimestamp()-$lastDateTime->getTimestamp(); |
|
| 143 | 143 | $days = $secs / (60 * 60 * 24); |
| 144 | 144 | return $days / count($this->topEdits); |
| 145 | 145 | } |