@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | public function getMaxRevisions() |
| 253 | 253 | { |
| 254 | 254 | if (!isset($this->maxRevisions)) { |
| 255 | - $this->maxRevisions = (int) $this->container->getParameter('app.max_page_revisions'); |
|
| 255 | + $this->maxRevisions = (int)$this->container->getParameter('app.max_page_revisions'); |
|
| 256 | 256 | } |
| 257 | 257 | return $this->maxRevisions; |
| 258 | 258 | } |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | $this->yearMonthCounts[$editYear]['all']++; |
| 942 | 942 | $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']++; |
| 943 | 943 | // This will ultimately be the size of the page by the end of the year |
| 944 | - $this->yearMonthCounts[$editYear]['size'] = (int) $edit->getLength(); |
|
| 944 | + $this->yearMonthCounts[$editYear]['size'] = (int)$edit->getLength(); |
|
| 945 | 945 | |
| 946 | 946 | // Keep track of which month had the most edits |
| 947 | 947 | $editsThisMonth = $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']; |
@@ -960,7 +960,7 @@ discard block |
||
| 960 | 960 | $editYear = $edit->getYear(); |
| 961 | 961 | |
| 962 | 962 | // Beginning of the month at 00:00:00. |
| 963 | - $firstEditTime = mktime(0, 0, 0, (int) $this->firstEdit->getMonth(), 1, $this->firstEdit->getYear()); |
|
| 963 | + $firstEditTime = mktime(0, 0, 0, (int)$this->firstEdit->getMonth(), 1, $this->firstEdit->getYear()); |
|
| 964 | 964 | |
| 965 | 965 | $this->yearMonthCounts[$editYear] = [ |
| 966 | 966 | 'all' => 0, |
@@ -1095,14 +1095,14 @@ discard block |
||
| 1095 | 1095 | $botData = $this->getRepository()->getBotData($this->page, $this->startDate, $this->endDate); |
| 1096 | 1096 | while ($bot = $botData->fetch()) { |
| 1097 | 1097 | $bots[$bot['username']] = [ |
| 1098 | - 'count' => (int) $bot['count'], |
|
| 1098 | + 'count' => (int)$bot['count'], |
|
| 1099 | 1099 | 'current' => $bot['current'] === 'bot', |
| 1100 | 1100 | ]; |
| 1101 | 1101 | } |
| 1102 | 1102 | |
| 1103 | 1103 | // Sort by edit count. |
| 1104 | - uasort($bots, function ($a, $b) { |
|
| 1105 | - return $b['count'] - $a['count']; |
|
| 1104 | + uasort($bots, function($a, $b) { |
|
| 1105 | + return $b['count']-$a['count']; |
|
| 1106 | 1106 | }); |
| 1107 | 1107 | |
| 1108 | 1108 | $this->bots = $bots; |
@@ -1217,7 +1217,7 @@ discard block |
||
| 1217 | 1217 | |
| 1218 | 1218 | if ($info['all'] > 1) { |
| 1219 | 1219 | // Number of seconds/days between first and last edit. |
| 1220 | - $secs = $info['last']->getTimestamp() - $info['first']->getTimestamp(); |
|
| 1220 | + $secs = $info['last']->getTimestamp()-$info['first']->getTimestamp(); |
|
| 1221 | 1221 | $days = $secs / (60 * 60 * 24); |
| 1222 | 1222 | |
| 1223 | 1223 | // Average time between edits (in days). |
@@ -1236,7 +1236,7 @@ discard block |
||
| 1236 | 1236 | |
| 1237 | 1237 | // First sort editors array by the amount of text they added. |
| 1238 | 1238 | $topTenEditorsByAdded = $this->editors; |
| 1239 | - uasort($topTenEditorsByAdded, function ($a, $b) { |
|
| 1239 | + uasort($topTenEditorsByAdded, function($a, $b) { |
|
| 1240 | 1240 | if ($a['added'] === $b['added']) { |
| 1241 | 1241 | return 0; |
| 1242 | 1242 | } |
@@ -1245,7 +1245,7 @@ discard block |
||
| 1245 | 1245 | |
| 1246 | 1246 | // Then build a new array of top 10 editors by added text, |
| 1247 | 1247 | // in the data structure needed for the chart. |
| 1248 | - $this->topTenEditorsByAdded = array_map(function ($editor) { |
|
| 1248 | + $this->topTenEditorsByAdded = array_map(function($editor) { |
|
| 1249 | 1249 | $added = $this->editors[$editor]['added']; |
| 1250 | 1250 | return [ |
| 1251 | 1251 | 'label' => $editor, |
@@ -1399,7 +1399,7 @@ discard block |
||
| 1399 | 1399 | |
| 1400 | 1400 | $refs = $crawler->filter('#mw-content-text .reference'); |
| 1401 | 1401 | $refContent = []; |
| 1402 | - $refs->each(function ($ref) use (&$refContent) { |
|
| 1402 | + $refs->each(function($ref) use (&$refContent) { |
|
| 1403 | 1403 | $refContent[] = $ref->text(); |
| 1404 | 1404 | }); |
| 1405 | 1405 | $uniqueRefs = count(array_unique($refContent)); |
@@ -1427,7 +1427,7 @@ discard block |
||
| 1427 | 1427 | $totalChars = 0; |
| 1428 | 1428 | $totalWords = 0; |
| 1429 | 1429 | $paragraphs = $crawler->filter($selector); |
| 1430 | - $paragraphs->each(function ($node) use (&$totalChars, &$totalWords) { |
|
| 1430 | + $paragraphs->each(function($node) use (&$totalChars, &$totalWords) { |
|
| 1431 | 1431 | $text = preg_replace('/\[\d+\]/', '', trim($node->text())); |
| 1432 | 1432 | $totalChars += strlen($text); |
| 1433 | 1433 | $totalWords += count(explode(' ', $text)); |