@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -declare(strict_types = 1); |
|
2 | +declare(strict_types=1); |
|
3 | 3 | |
4 | 4 | use Symfony\Component\ErrorHandler\Debug; |
5 | 5 | use Symfony\Component\HttpFoundation\Request; |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | // Feel free to remove this, extend it, or make something more sophisticated. |
14 | 14 | if (isset($_SERVER['HTTP_CLIENT_IP']) |
15 | 15 | || isset($_SERVER['HTTP_X_FORWARDED_FOR']) |
16 | - || !( in_array(@$_SERVER['REMOTE_ADDR'], [ '127.0.0.1', 'fe80::1', '::1' ]) || 'cli-server' === php_sapi_name() ) |
|
16 | + || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || 'cli-server' === php_sapi_name()) |
|
17 | 17 | ) { |
18 | 18 | header('HTTP/1.0 403 Forbidden'); |
19 | 19 | exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); |
@@ -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 | |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | $refs = $crawler->filter('#mw-content-text .reference'); |
168 | 168 | $refContent = []; |
169 | - $refs->each(function ($ref) use (&$refContent): void { |
|
169 | + $refs->each(function($ref) use (&$refContent): void { |
|
170 | 170 | $refContent[] = $ref->text(); |
171 | 171 | }); |
172 | 172 | $uniqueRefs = count(array_unique($refContent)); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $totalChars = 0; |
195 | 195 | $totalWords = 0; |
196 | 196 | $paragraphs = $crawler->filter($selector); |
197 | - $paragraphs->each(function ($node) use (&$totalChars, &$totalWords): void { |
|
197 | + $paragraphs->each(function($node) use (&$totalChars, &$totalWords): void { |
|
198 | 198 | /** @var Crawler $node */ |
199 | 199 | $text = preg_replace('/\[\d+]/', '', trim($node->text(null, true))); |
200 | 200 | $totalChars += strlen($text); |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | $data = [ |
259 | 259 | 'project' => $project->getDomain(), |
260 | 260 | 'page' => $page->getTitle(), |
261 | - 'watchers' => (int) $page->getWatchers(), |
|
261 | + 'watchers' => (int)$page->getWatchers(), |
|
262 | 262 | 'pageviews' => $page->getLastPageviews($pageviewsOffset), |
263 | 263 | 'pageviews_offset' => $pageviewsOffset, |
264 | 264 | ]; |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | if (false !== $info) { |
284 | 284 | $creationDateTime = DateTime::createFromFormat('YmdHis', $info['created_at']); |
285 | 285 | $modifiedDateTime = DateTime::createFromFormat('YmdHis', $info['modified_at']); |
286 | - $secsSinceLastEdit = (new DateTime)->getTimestamp() - $modifiedDateTime->getTimestamp(); |
|
286 | + $secsSinceLastEdit = (new DateTime)->getTimestamp()-$modifiedDateTime->getTimestamp(); |
|
287 | 287 | |
288 | 288 | // Some wikis (such foundation.wikimedia.org) may be missing the creation date. |
289 | 289 | $creationDateTime = false === $creationDateTime |
@@ -295,16 +295,16 @@ discard block |
||
295 | 295 | ->getAssessment($page); |
296 | 296 | |
297 | 297 | $data = array_merge($data, [ |
298 | - 'revisions' => (int) $info['num_edits'], |
|
299 | - 'editors' => (int) $info['num_editors'], |
|
300 | - 'minor_edits' => (int) $info['minor_edits'], |
|
298 | + 'revisions' => (int)$info['num_edits'], |
|
299 | + 'editors' => (int)$info['num_editors'], |
|
300 | + 'minor_edits' => (int)$info['minor_edits'], |
|
301 | 301 | 'author' => $info['author'], |
302 | - 'author_editcount' => (int) $info['author_editcount'], |
|
302 | + 'author_editcount' => (int)$info['author_editcount'], |
|
303 | 303 | 'created_at' => $creationDateTime, |
304 | 304 | 'created_rev_id' => $info['created_rev_id'], |
305 | 305 | 'modified_at' => $modifiedDateTime->format('Y-m-d H:i'), |
306 | 306 | 'secs_since_last_edit' => $secsSinceLastEdit, |
307 | - 'last_edit_id' => (int) $info['modified_rev_id'], |
|
307 | + 'last_edit_id' => (int)$info['modified_rev_id'], |
|
308 | 308 | 'assessment' => $assessment, |
309 | 309 | ]); |
310 | 310 | } |
@@ -454,8 +454,8 @@ discard block |
||
454 | 454 | } |
455 | 455 | |
456 | 456 | // Sort by edit count. |
457 | - uasort($this->bots, function ($a, $b) { |
|
458 | - return $b['count'] - $a['count']; |
|
457 | + uasort($this->bots, function($a, $b) { |
|
458 | + return $b['count']-$a['count']; |
|
459 | 459 | }); |
460 | 460 | |
461 | 461 | return $this->bots; |