Passed
Push — master ( a546ea...5d2b18 )
by MusikAnimal
04:33
created
src/Xtools/ArticleInfo.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
     public function getMaxRevisions()
242 242
     {
243 243
         if (!isset($this->maxRevisions)) {
244
-            $this->maxRevisions = (int) $this->container->getParameter('app.max_page_revisions');
244
+            $this->maxRevisions = (int)$this->container->getParameter('app.max_page_revisions');
245 245
         }
246 246
         return $this->maxRevisions;
247 247
     }
@@ -1010,7 +1010,7 @@  discard block
 block discarded – undo
1010 1010
         $this->yearMonthCounts[$editYear]['all']++;
1011 1011
         $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']++;
1012 1012
         // This will ultimately be the size of the page by the end of the year
1013
-        $this->yearMonthCounts[$editYear]['size'] = (int) $edit->getLength();
1013
+        $this->yearMonthCounts[$editYear]['size'] = (int)$edit->getLength();
1014 1014
 
1015 1015
         // Keep track of which month had the most edits
1016 1016
         $editsThisMonth = $this->yearMonthCounts[$editYear]['months'][$editMonth]['all'];
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
         $editYear = $edit->getYear();
1031 1031
 
1032 1032
         // Beginning of the month at 00:00:00.
1033
-        $firstEditTime = mktime(0, 0, 0, (int) $this->firstEdit->getMonth(), 1, $this->firstEdit->getYear());
1033
+        $firstEditTime = mktime(0, 0, 0, (int)$this->firstEdit->getMonth(), 1, $this->firstEdit->getYear());
1034 1034
 
1035 1035
         $this->yearMonthCounts[$editYear] = [
1036 1036
             'all' => 0,
@@ -1165,8 +1165,8 @@  discard block
 block discarded – undo
1165 1165
         }
1166 1166
 
1167 1167
         // Sort by edit count.
1168
-        uasort($bots, function ($a, $b) {
1169
-            return $b['count'] - $a['count'];
1168
+        uasort($bots, function($a, $b) {
1169
+            return $b['count']-$a['count'];
1170 1170
         });
1171 1171
 
1172 1172
         $this->bots = $bots;
@@ -1275,7 +1275,7 @@  discard block
 block discarded – undo
1275 1275
 
1276 1276
             if ($info['all'] > 1) {
1277 1277
                 // Number of seconds/days between first and last edit.
1278
-                $secs = $info['last']->getTimestamp() - $info['first']->getTimestamp();
1278
+                $secs = $info['last']->getTimestamp()-$info['first']->getTimestamp();
1279 1279
                 $days = $secs / (60 * 60 * 24);
1280 1280
 
1281 1281
                 // Average time between edits (in days).
@@ -1284,7 +1284,7 @@  discard block
 block discarded – undo
1284 1284
         }
1285 1285
 
1286 1286
         // Loop through again and add percentages.
1287
-        $this->topTenEditorsByEdits = array_map(function ($editor) use ($topTenCount) {
1287
+        $this->topTenEditorsByEdits = array_map(function($editor) use ($topTenCount) {
1288 1288
             $editor['percentage'] = 100 * ($editor['value'] / $topTenCount);
1289 1289
             return $editor;
1290 1290
         }, $topTenEditorsByEdits);
@@ -1302,7 +1302,7 @@  discard block
 block discarded – undo
1302 1302
     {
1303 1303
         // First sort editors array by the amount of text they added.
1304 1304
         $topTenEditorsByAdded = $this->editors;
1305
-        uasort($topTenEditorsByAdded, function ($a, $b) {
1305
+        uasort($topTenEditorsByAdded, function($a, $b) {
1306 1306
             if ($a['added'] === $b['added']) {
1307 1307
                 return 0;
1308 1308
             }
@@ -1313,12 +1313,12 @@  discard block
 block discarded – undo
1313 1313
         $topTenEditorsByAdded = array_keys(array_slice($topTenEditorsByAdded, 0, 10, true));
1314 1314
 
1315 1315
         // Get the sum of added text so that we can add in percentages.
1316
-        $topTenTotalAdded = array_sum(array_map(function ($editor) {
1316
+        $topTenTotalAdded = array_sum(array_map(function($editor) {
1317 1317
             return $this->editors[$editor]['added'];
1318 1318
         }, $topTenEditorsByAdded));
1319 1319
 
1320 1320
         // Then build a new array of top 10 editors by added text in the data structure needed for the chart.
1321
-        return array_map(function ($editor) use ($topTenTotalAdded) {
1321
+        return array_map(function($editor) use ($topTenTotalAdded) {
1322 1322
             $added = $this->editors[$editor]['added'];
1323 1323
             return [
1324 1324
                 'label' => $editor,
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
 
1471 1471
         $refs = $crawler->filter('#mw-content-text .reference');
1472 1472
         $refContent = [];
1473
-        $refs->each(function ($ref) use (&$refContent) {
1473
+        $refs->each(function($ref) use (&$refContent) {
1474 1474
             $refContent[] = $ref->text();
1475 1475
         });
1476 1476
         $uniqueRefs = count(array_unique($refContent));
@@ -1497,7 +1497,7 @@  discard block
 block discarded – undo
1497 1497
         $totalChars = 0;
1498 1498
         $totalWords = 0;
1499 1499
         $paragraphs = $crawler->filter($selector);
1500
-        $paragraphs->each(function ($node) use (&$totalChars, &$totalWords) {
1500
+        $paragraphs->each(function($node) use (&$totalChars, &$totalWords) {
1501 1501
             $text = preg_replace('/\[\d+\]/', '', trim($node->text()));
1502 1502
             $totalChars += strlen($text);
1503 1503
             $totalWords += count(explode(' ', $text));
Please login to merge, or discard this patch.