@@ -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\Model; |
| 5 | 5 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | $refs = $crawler->filter('#mw-content-text .reference'); |
| 150 | 150 | $refContent = []; |
| 151 | - $refs->each(function ($ref) use (&$refContent): void { |
|
| 151 | + $refs->each(function($ref) use (&$refContent): void { |
|
| 152 | 152 | $refContent[] = $ref->text(); |
| 153 | 153 | }); |
| 154 | 154 | $uniqueRefs = count(array_unique($refContent)); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $totalChars = 0; |
| 177 | 177 | $totalWords = 0; |
| 178 | 178 | $paragraphs = $crawler->filter($selector); |
| 179 | - $paragraphs->each(function ($node) use (&$totalChars, &$totalWords): void { |
|
| 179 | + $paragraphs->each(function($node) use (&$totalChars, &$totalWords): void { |
|
| 180 | 180 | /** @var Crawler $node */ |
| 181 | 181 | $text = preg_replace('/\[\d+]/', '', trim($node->text(null, true))); |
| 182 | 182 | $totalChars += strlen($text); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | $data = [ |
| 241 | 241 | 'project' => $project->getDomain(), |
| 242 | 242 | 'page' => $page->getTitle(), |
| 243 | - 'watchers' => (int) $page->getWatchers(), |
|
| 243 | + 'watchers' => (int)$page->getWatchers(), |
|
| 244 | 244 | 'pageviews' => $page->getLastPageviews($pageviewsOffset), |
| 245 | 245 | 'pageviews_offset' => $pageviewsOffset, |
| 246 | 246 | ]; |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | if (false !== $info) { |
| 266 | 266 | $creationDateTime = DateTime::createFromFormat('YmdHis', $info['created_at']); |
| 267 | 267 | $modifiedDateTime = DateTime::createFromFormat('YmdHis', $info['modified_at']); |
| 268 | - $secsSinceLastEdit = (new DateTime)->getTimestamp() - $modifiedDateTime->getTimestamp(); |
|
| 268 | + $secsSinceLastEdit = (new DateTime)->getTimestamp()-$modifiedDateTime->getTimestamp(); |
|
| 269 | 269 | |
| 270 | 270 | // Some wikis (such foundation.wikimedia.org) may be missing the creation date. |
| 271 | 271 | $creationDateTime = false === $creationDateTime |
@@ -277,16 +277,16 @@ discard block |
||
| 277 | 277 | ->getAssessment($page); |
| 278 | 278 | |
| 279 | 279 | $data = array_merge($data, [ |
| 280 | - 'revisions' => (int) $info['num_edits'], |
|
| 281 | - 'editors' => (int) $info['num_editors'], |
|
| 282 | - 'minor_edits' => (int) $info['minor_edits'], |
|
| 280 | + 'revisions' => (int)$info['num_edits'], |
|
| 281 | + 'editors' => (int)$info['num_editors'], |
|
| 282 | + 'minor_edits' => (int)$info['minor_edits'], |
|
| 283 | 283 | 'author' => $info['author'], |
| 284 | - 'author_editcount' => null === $info['author_editcount'] ? null : (int) $info['author_editcount'], |
|
| 284 | + 'author_editcount' => null === $info['author_editcount'] ? null : (int)$info['author_editcount'], |
|
| 285 | 285 | 'created_at' => $creationDateTime, |
| 286 | 286 | 'created_rev_id' => $info['created_rev_id'], |
| 287 | 287 | 'modified_at' => $modifiedDateTime->format('Y-m-d H:i'), |
| 288 | 288 | 'secs_since_last_edit' => $secsSinceLastEdit, |
| 289 | - 'last_edit_id' => (int) $info['modified_rev_id'], |
|
| 289 | + 'last_edit_id' => (int)$info['modified_rev_id'], |
|
| 290 | 290 | 'assessment' => $assessment, |
| 291 | 291 | ]); |
| 292 | 292 | } |
@@ -436,8 +436,8 @@ discard block |
||
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | // Sort by edit count. |
| 439 | - uasort($this->bots, function ($a, $b) { |
|
| 440 | - return $b['count'] - $a['count']; |
|
| 439 | + uasort($this->bots, function($a, $b) { |
|
| 440 | + return $b['count']-$a['count']; |
|
| 441 | 441 | }); |
| 442 | 442 | |
| 443 | 443 | return $this->bots; |