@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the ArticleInfo class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Model; |
| 9 | 9 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | public function getMaxRevisions(): int |
| 244 | 244 | { |
| 245 | 245 | if (!isset($this->maxRevisions)) { |
| 246 | - $this->maxRevisions = (int) $this->container->getParameter('app.max_page_revisions'); |
|
| 246 | + $this->maxRevisions = (int)$this->container->getParameter('app.max_page_revisions'); |
|
| 247 | 247 | } |
| 248 | 248 | return $this->maxRevisions; |
| 249 | 249 | } |
@@ -1012,7 +1012,7 @@ discard block |
||
| 1012 | 1012 | $this->yearMonthCounts[$editYear]['all']++; |
| 1013 | 1013 | $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']++; |
| 1014 | 1014 | // This will ultimately be the size of the page by the end of the year |
| 1015 | - $this->yearMonthCounts[$editYear]['size'] = (int) $edit->getLength(); |
|
| 1015 | + $this->yearMonthCounts[$editYear]['size'] = (int)$edit->getLength(); |
|
| 1016 | 1016 | |
| 1017 | 1017 | // Keep track of which month had the most edits |
| 1018 | 1018 | $editsThisMonth = $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']; |
@@ -1167,8 +1167,8 @@ discard block |
||
| 1167 | 1167 | } |
| 1168 | 1168 | |
| 1169 | 1169 | // Sort by edit count. |
| 1170 | - uasort($bots, function ($a, $b) { |
|
| 1171 | - return $b['count'] - $a['count']; |
|
| 1170 | + uasort($bots, function($a, $b) { |
|
| 1171 | + return $b['count']-$a['count']; |
|
| 1172 | 1172 | }); |
| 1173 | 1173 | |
| 1174 | 1174 | $this->bots = $bots; |
@@ -1277,7 +1277,7 @@ discard block |
||
| 1277 | 1277 | |
| 1278 | 1278 | if ($info['all'] > 1) { |
| 1279 | 1279 | // Number of seconds/days between first and last edit. |
| 1280 | - $secs = $info['last']->getTimestamp() - $info['first']->getTimestamp(); |
|
| 1280 | + $secs = $info['last']->getTimestamp()-$info['first']->getTimestamp(); |
|
| 1281 | 1281 | $days = $secs / (60 * 60 * 24); |
| 1282 | 1282 | |
| 1283 | 1283 | // Average time between edits (in days). |
@@ -1286,7 +1286,7 @@ discard block |
||
| 1286 | 1286 | } |
| 1287 | 1287 | |
| 1288 | 1288 | // Loop through again and add percentages. |
| 1289 | - $this->topTenEditorsByEdits = array_map(function ($editor) use ($topTenCount) { |
|
| 1289 | + $this->topTenEditorsByEdits = array_map(function($editor) use ($topTenCount) { |
|
| 1290 | 1290 | $editor['percentage'] = 100 * ($editor['value'] / $topTenCount); |
| 1291 | 1291 | return $editor; |
| 1292 | 1292 | }, $topTenEditorsByEdits); |
@@ -1304,7 +1304,7 @@ discard block |
||
| 1304 | 1304 | { |
| 1305 | 1305 | // First sort editors array by the amount of text they added. |
| 1306 | 1306 | $topTenEditorsByAdded = $this->editors; |
| 1307 | - uasort($topTenEditorsByAdded, function ($a, $b) { |
|
| 1307 | + uasort($topTenEditorsByAdded, function($a, $b) { |
|
| 1308 | 1308 | if ($a['added'] === $b['added']) { |
| 1309 | 1309 | return 0; |
| 1310 | 1310 | } |
@@ -1320,7 +1320,7 @@ discard block |
||
| 1320 | 1320 | // }, $topTenEditorsByAdded)); |
| 1321 | 1321 | |
| 1322 | 1322 | // Then build a new array of top 10 editors by added text in the data structure needed for the chart. |
| 1323 | - return array_map(function ($editor) { |
|
| 1323 | + return array_map(function($editor) { |
|
| 1324 | 1324 | $added = $this->editors[$editor]['added']; |
| 1325 | 1325 | return [ |
| 1326 | 1326 | 'label' => $editor, |
@@ -1406,9 +1406,9 @@ discard block |
||
| 1406 | 1406 | // Record character count and percentage for the remaining editors. |
| 1407 | 1407 | if ($percentageSum < 100) { |
| 1408 | 1408 | $this->textshares['others'] = [ |
| 1409 | - 'count' => $totalCount - $countSum, |
|
| 1410 | - 'percentage' => round(100 - $percentageSum, 1), |
|
| 1411 | - 'numEditors' => count($counts) - $numEditors, |
|
| 1409 | + 'count' => $totalCount-$countSum, |
|
| 1410 | + 'percentage' => round(100-$percentageSum, 1), |
|
| 1411 | + 'numEditors' => count($counts)-$numEditors, |
|
| 1412 | 1412 | ]; |
| 1413 | 1413 | } |
| 1414 | 1414 | |
@@ -1500,7 +1500,7 @@ discard block |
||
| 1500 | 1500 | |
| 1501 | 1501 | $refs = $crawler->filter('#mw-content-text .reference'); |
| 1502 | 1502 | $refContent = []; |
| 1503 | - $refs->each(function ($ref) use (&$refContent): void { |
|
| 1503 | + $refs->each(function($ref) use (&$refContent): void { |
|
| 1504 | 1504 | $refContent[] = $ref->text(); |
| 1505 | 1505 | }); |
| 1506 | 1506 | $uniqueRefs = count(array_unique($refContent)); |
@@ -1527,7 +1527,7 @@ discard block |
||
| 1527 | 1527 | $totalChars = 0; |
| 1528 | 1528 | $totalWords = 0; |
| 1529 | 1529 | $paragraphs = $crawler->filter($selector); |
| 1530 | - $paragraphs->each(function ($node) use (&$totalChars, &$totalWords): void { |
|
| 1530 | + $paragraphs->each(function($node) use (&$totalChars, &$totalWords): void { |
|
| 1531 | 1531 | $text = preg_replace('/\[\d+\]/', '', trim($node->text())); |
| 1532 | 1532 | $totalChars += strlen($text); |
| 1533 | 1533 | $totalWords += count(explode(' ', $text)); |