@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | public function getMaxRevisions() |
| 234 | 234 | { |
| 235 | 235 | if (!isset($this->maxRevisions)) { |
| 236 | - $this->maxRevisions = (int) $this->container->getParameter('app.max_page_revisions'); |
|
| 236 | + $this->maxRevisions = (int)$this->container->getParameter('app.max_page_revisions'); |
|
| 237 | 237 | } |
| 238 | 238 | return $this->maxRevisions; |
| 239 | 239 | } |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | $this->yearMonthCounts[$editYear]['all']++; |
| 923 | 923 | $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']++; |
| 924 | 924 | // This will ultimately be the size of the page by the end of the year |
| 925 | - $this->yearMonthCounts[$editYear]['size'] = (int) $edit->getLength(); |
|
| 925 | + $this->yearMonthCounts[$editYear]['size'] = (int)$edit->getLength(); |
|
| 926 | 926 | |
| 927 | 927 | // Keep track of which month had the most edits |
| 928 | 928 | $editsThisMonth = $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']; |
@@ -941,7 +941,7 @@ discard block |
||
| 941 | 941 | $editYear = $edit->getYear(); |
| 942 | 942 | |
| 943 | 943 | // Beginning of the month at 00:00:00. |
| 944 | - $firstEditTime = mktime(0, 0, 0, (int) $this->firstEdit->getMonth(), 1, $this->firstEdit->getYear()); |
|
| 944 | + $firstEditTime = mktime(0, 0, 0, (int)$this->firstEdit->getMonth(), 1, $this->firstEdit->getYear()); |
|
| 945 | 945 | |
| 946 | 946 | $this->yearMonthCounts[$editYear] = [ |
| 947 | 947 | 'all' => 0, |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | for ($i = 1; $i <= 12; $i++) { |
| 957 | 957 | $timeObj = mktime(0, 0, 0, $i, 1, $editYear); |
| 958 | 958 | |
| 959 | - $date = $editYear . sprintf('%02d', $i) . '01'; |
|
| 959 | + $date = $editYear.sprintf('%02d', $i).'01'; |
|
| 960 | 960 | if (false !== $this->startDate && $date < date('Ymd', $this->startDate) |
| 961 | 961 | || false !== $this->endDate && $date > date('Ymd', $this->endDate)) { |
| 962 | 962 | continue; |
@@ -1082,14 +1082,14 @@ discard block |
||
| 1082 | 1082 | $botData = $this->getRepository()->getBotData($this->page, $this->startDate, $this->endDate); |
| 1083 | 1083 | while ($bot = $botData->fetch()) { |
| 1084 | 1084 | $bots[$bot['username']] = [ |
| 1085 | - 'count' => (int) $bot['count'], |
|
| 1085 | + 'count' => (int)$bot['count'], |
|
| 1086 | 1086 | 'current' => $bot['current'] === 'bot', |
| 1087 | 1087 | ]; |
| 1088 | 1088 | } |
| 1089 | 1089 | |
| 1090 | 1090 | // Sort by edit count. |
| 1091 | - uasort($bots, function ($a, $b) { |
|
| 1092 | - return $b['count'] - $a['count']; |
|
| 1091 | + uasort($bots, function($a, $b) { |
|
| 1092 | + return $b['count']-$a['count']; |
|
| 1093 | 1093 | }); |
| 1094 | 1094 | |
| 1095 | 1095 | $this->bots = $bots; |
@@ -1204,7 +1204,7 @@ discard block |
||
| 1204 | 1204 | |
| 1205 | 1205 | if ($info['all'] > 1) { |
| 1206 | 1206 | // Number of seconds/days between first and last edit. |
| 1207 | - $secs = $info['last']->getTimestamp() - $info['first']->getTimestamp(); |
|
| 1207 | + $secs = $info['last']->getTimestamp()-$info['first']->getTimestamp(); |
|
| 1208 | 1208 | $days = $secs / (60 * 60 * 24); |
| 1209 | 1209 | |
| 1210 | 1210 | // Average time between edits (in days). |
@@ -1223,7 +1223,7 @@ discard block |
||
| 1223 | 1223 | |
| 1224 | 1224 | // First sort editors array by the amount of text they added. |
| 1225 | 1225 | $topTenEditorsByAdded = $this->editors; |
| 1226 | - uasort($topTenEditorsByAdded, function ($a, $b) { |
|
| 1226 | + uasort($topTenEditorsByAdded, function($a, $b) { |
|
| 1227 | 1227 | if ($a['added'] === $b['added']) { |
| 1228 | 1228 | return 0; |
| 1229 | 1229 | } |
@@ -1232,7 +1232,7 @@ discard block |
||
| 1232 | 1232 | |
| 1233 | 1233 | // Then build a new array of top 10 editors by added text, |
| 1234 | 1234 | // in the data structure needed for the chart. |
| 1235 | - $this->topTenEditorsByAdded = array_map(function ($editor) { |
|
| 1235 | + $this->topTenEditorsByAdded = array_map(function($editor) { |
|
| 1236 | 1236 | $added = $this->editors[$editor]['added']; |
| 1237 | 1237 | return [ |
| 1238 | 1238 | 'label' => $editor, |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | |
| 1386 | 1386 | $refs = $crawler->filter('#mw-content-text .reference'); |
| 1387 | 1387 | $refContent = []; |
| 1388 | - $refs->each(function ($ref) use (&$refContent) { |
|
| 1388 | + $refs->each(function($ref) use (&$refContent) { |
|
| 1389 | 1389 | $refContent[] = $ref->text(); |
| 1390 | 1390 | }); |
| 1391 | 1391 | $uniqueRefs = count(array_unique($refContent)); |
@@ -1413,7 +1413,7 @@ discard block |
||
| 1413 | 1413 | $totalChars = 0; |
| 1414 | 1414 | $totalWords = 0; |
| 1415 | 1415 | $paragraphs = $crawler->filter($selector); |
| 1416 | - $paragraphs->each(function ($node) use (&$totalChars, &$totalWords) { |
|
| 1416 | + $paragraphs->each(function($node) use (&$totalChars, &$totalWords) { |
|
| 1417 | 1417 | $text = preg_replace('/\[\d+\]/', '', trim($node->text())); |
| 1418 | 1418 | $totalChars += strlen($text); |
| 1419 | 1419 | $totalWords += count(explode(' ', $text)); |