@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | public function getMaxRevisions() |
| 245 | 245 | { |
| 246 | 246 | if (!isset($this->maxRevisions)) { |
| 247 | - $this->maxRevisions = (int) $this->container->getParameter('app.max_page_revisions'); |
|
| 247 | + $this->maxRevisions = (int)$this->container->getParameter('app.max_page_revisions'); |
|
| 248 | 248 | } |
| 249 | 249 | return $this->maxRevisions; |
| 250 | 250 | } |
@@ -1017,7 +1017,7 @@ discard block |
||
| 1017 | 1017 | $this->yearMonthCounts[$editYear]['all']++; |
| 1018 | 1018 | $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']++; |
| 1019 | 1019 | // This will ultimately be the size of the page by the end of the year |
| 1020 | - $this->yearMonthCounts[$editYear]['size'] = (int) $edit->getLength(); |
|
| 1020 | + $this->yearMonthCounts[$editYear]['size'] = (int)$edit->getLength(); |
|
| 1021 | 1021 | |
| 1022 | 1022 | // Keep track of which month had the most edits |
| 1023 | 1023 | $editsThisMonth = $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']; |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | $editYear = $edit->getYear(); |
| 1038 | 1038 | |
| 1039 | 1039 | // Beginning of the month at 00:00:00. |
| 1040 | - $firstEditTime = mktime(0, 0, 0, (int) $this->firstEdit->getMonth(), 1, $this->firstEdit->getYear()); |
|
| 1040 | + $firstEditTime = mktime(0, 0, 0, (int)$this->firstEdit->getMonth(), 1, $this->firstEdit->getYear()); |
|
| 1041 | 1041 | |
| 1042 | 1042 | $this->yearMonthCounts[$editYear] = [ |
| 1043 | 1043 | 'all' => 0, |
@@ -1169,14 +1169,14 @@ discard block |
||
| 1169 | 1169 | $botData = $this->getRepository()->getBotData($this->page, $this->start, $this->end); |
| 1170 | 1170 | while ($bot = $botData->fetch()) { |
| 1171 | 1171 | $bots[$bot['username']] = [ |
| 1172 | - 'count' => (int) $bot['count'], |
|
| 1172 | + 'count' => (int)$bot['count'], |
|
| 1173 | 1173 | 'current' => $bot['current'] === 'bot', |
| 1174 | 1174 | ]; |
| 1175 | 1175 | } |
| 1176 | 1176 | |
| 1177 | 1177 | // Sort by edit count. |
| 1178 | - uasort($bots, function ($a, $b) { |
|
| 1179 | - return $b['count'] - $a['count']; |
|
| 1178 | + uasort($bots, function($a, $b) { |
|
| 1179 | + return $b['count']-$a['count']; |
|
| 1180 | 1180 | }); |
| 1181 | 1181 | |
| 1182 | 1182 | $this->bots = $bots; |
@@ -1287,7 +1287,7 @@ discard block |
||
| 1287 | 1287 | |
| 1288 | 1288 | if ($info['all'] > 1) { |
| 1289 | 1289 | // Number of seconds/days between first and last edit. |
| 1290 | - $secs = $info['last']->getTimestamp() - $info['first']->getTimestamp(); |
|
| 1290 | + $secs = $info['last']->getTimestamp()-$info['first']->getTimestamp(); |
|
| 1291 | 1291 | $days = $secs / (60 * 60 * 24); |
| 1292 | 1292 | |
| 1293 | 1293 | // Average time between edits (in days). |
@@ -1296,7 +1296,7 @@ discard block |
||
| 1296 | 1296 | } |
| 1297 | 1297 | |
| 1298 | 1298 | // Loop through again and add percentages. |
| 1299 | - $this->topTenEditorsByEdits = array_map(function ($editor) use ($topTenCount) { |
|
| 1299 | + $this->topTenEditorsByEdits = array_map(function($editor) use ($topTenCount) { |
|
| 1300 | 1300 | $editor['percentage'] = 100 * ($editor['value'] / $topTenCount); |
| 1301 | 1301 | return $editor; |
| 1302 | 1302 | }, $topTenEditorsByEdits); |
@@ -1314,7 +1314,7 @@ discard block |
||
| 1314 | 1314 | { |
| 1315 | 1315 | // First sort editors array by the amount of text they added. |
| 1316 | 1316 | $topTenEditorsByAdded = $this->editors; |
| 1317 | - uasort($topTenEditorsByAdded, function ($a, $b) { |
|
| 1317 | + uasort($topTenEditorsByAdded, function($a, $b) { |
|
| 1318 | 1318 | if ($a['added'] === $b['added']) { |
| 1319 | 1319 | return 0; |
| 1320 | 1320 | } |
@@ -1325,12 +1325,12 @@ discard block |
||
| 1325 | 1325 | $topTenEditorsByAdded = array_keys(array_slice($topTenEditorsByAdded, 0, 10, true)); |
| 1326 | 1326 | |
| 1327 | 1327 | // Get the sum of added text so that we can add in percentages. |
| 1328 | - $topTenTotalAdded = array_sum(array_map(function ($editor) { |
|
| 1328 | + $topTenTotalAdded = array_sum(array_map(function($editor) { |
|
| 1329 | 1329 | return $this->editors[$editor]['added']; |
| 1330 | 1330 | }, $topTenEditorsByAdded)); |
| 1331 | 1331 | |
| 1332 | 1332 | // Then build a new array of top 10 editors by added text in the data structure needed for the chart. |
| 1333 | - return array_map(function ($editor) use ($topTenTotalAdded) { |
|
| 1333 | + return array_map(function($editor) use ($topTenTotalAdded) { |
|
| 1334 | 1334 | $added = $this->editors[$editor]['added']; |
| 1335 | 1335 | return [ |
| 1336 | 1336 | 'label' => $editor, |
@@ -1482,7 +1482,7 @@ discard block |
||
| 1482 | 1482 | |
| 1483 | 1483 | $refs = $crawler->filter('#mw-content-text .reference'); |
| 1484 | 1484 | $refContent = []; |
| 1485 | - $refs->each(function ($ref) use (&$refContent) { |
|
| 1485 | + $refs->each(function($ref) use (&$refContent) { |
|
| 1486 | 1486 | $refContent[] = $ref->text(); |
| 1487 | 1487 | }); |
| 1488 | 1488 | $uniqueRefs = count(array_unique($refContent)); |
@@ -1510,7 +1510,7 @@ discard block |
||
| 1510 | 1510 | $totalChars = 0; |
| 1511 | 1511 | $totalWords = 0; |
| 1512 | 1512 | $paragraphs = $crawler->filter($selector); |
| 1513 | - $paragraphs->each(function ($node) use (&$totalChars, &$totalWords) { |
|
| 1513 | + $paragraphs->each(function($node) use (&$totalChars, &$totalWords) { |
|
| 1514 | 1514 | $text = preg_replace('/\[\d+\]/', '', trim($node->text())); |
| 1515 | 1515 | $totalChars += strlen($text); |
| 1516 | 1516 | $totalWords += count(explode(' ', $text)); |