Completed
Push — master ( 16b0bc...e7ccc4 )
by Sam
08:57
created
src/Xtools/EditCounter.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     protected function getRevisionCounts()
56 56
     {
57
-        if (! is_array($this->revisionCounts)) {
57
+        if (!is_array($this->revisionCounts)) {
58 58
             $this->revisionCounts = $this->getRepository()
59 59
                 ->getRevisionCounts($this->project, $this->user);
60 60
         }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     protected function getRevisionDates()
69 69
     {
70
-        if (! is_array($this->revisionDates)) {
70
+        if (!is_array($this->revisionDates)) {
71 71
             $this->revisionDates = $this->getRepository()
72 72
                 ->getRevisionDates($this->project, $this->user);
73 73
         }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     protected function getPageCounts()
82 82
     {
83
-        if (! is_array($this->pageCounts)) {
83
+        if (!is_array($this->pageCounts)) {
84 84
             $this->pageCounts = $this->getRepository()
85 85
                 ->getPageCounts($this->project, $this->user);
86 86
         }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     protected function getLogCounts()
95 95
     {
96
-        if (! is_array($this->logCounts)) {
96
+        if (!is_array($this->logCounts)) {
97 97
             $this->logCounts = $this->getRepository()
98 98
                 ->getLogCounts($this->project, $this->user);
99 99
         }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     public function countAllRevisions()
144 144
     {
145
-        return $this->countLiveRevisions() + $this->countDeletedRevisions();
145
+        return $this->countLiveRevisions()+$this->countDeletedRevisions();
146 146
     }
147 147
 
148 148
     /**
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
      */
162 162
     public function countRevisionsWithoutComments()
163 163
     {
164
-        return $this->countAllRevisions() - $this->countRevisionsWithComments();
164
+        return $this->countAllRevisions()-$this->countRevisionsWithComments();
165 165
     }
166 166
 
167 167
     /**
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
      */
229 229
     public function countAllPagesEdited()
230 230
     {
231
-        return $this->countLivePagesEdited() + $this->countDeletedPagesEdited();
231
+        return $this->countLivePagesEdited()+$this->countDeletedPagesEdited();
232 232
     }
233 233
 
234 234
     /**
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
      */
239 239
     public function countPagesCreated()
240 240
     {
241
-        return $this->countCreatedPagesLive() + $this->countPagesCreatedDeleted();
241
+        return $this->countCreatedPagesLive()+$this->countPagesCreatedDeleted();
242 242
     }
243 243
 
244 244
     /**
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
         $logCounts = $this->getLogCounts();
291 291
         $block = isset($logCounts['block-block']) ? (int)$logCounts['block-block'] : 0;
292 292
         $reBlock = isset($logCounts['block-reblock']) ? (int)$logCounts['block-reblock'] : 0;
293
-        return $block + $reBlock;
293
+        return $block+$reBlock;
294 294
     }
295 295
 
296 296
     /**
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
         $import = isset($logCounts['import-import']) ? (int)$logCounts['import-import'] : 0;
389 389
         $interwiki = isset($logCounts['import-interwiki']) ? (int)$logCounts['import-interwiki'] : 0;
390 390
         $upload = isset($logCounts['import-upload']) ? (int)$logCounts['import-upload'] : 0;
391
-        return $import + $interwiki + $upload;
391
+        return $import+$interwiki+$upload;
392 392
     }
393 393
 
394 394
     /**
@@ -521,9 +521,9 @@  discard block
 block discarded – undo
521 521
     public function approvals()
522 522
     {
523 523
         $logCounts = $this->getLogCounts();
524
-        $total = $logCounts['review-approve'] +
525
-        (!empty($logCounts['review-approve-a']) ? $logCounts['review-approve-a'] : 0) +
526
-        (!empty($logCounts['review-approve-i']) ? $logCounts['review-approve-i'] : 0) +
524
+        $total = $logCounts['review-approve']+
525
+        (!empty($logCounts['review-approve-a']) ? $logCounts['review-approve-a'] : 0)+
526
+        (!empty($logCounts['review-approve-i']) ? $logCounts['review-approve-i'] : 0)+
527 527
         (!empty($logCounts['review-approve-ia']) ? $logCounts['review-approve-ia'] : 0);
528 528
         return $total;
529 529
     }
@@ -605,14 +605,14 @@  discard block
 block discarded – undo
605 605
             if (!isset($out['totals'][$ns])) {
606 606
                 $out['totals'][$ns] = [];
607 607
             }
608
-            $out['totals'][$ns][$total['year'] . $total['month']] = $total['count'];
608
+            $out['totals'][$ns][$total['year'].$total['month']] = $total['count'];
609 609
         }
610 610
         // Fill in the blanks (where no edits were made in a given month for a namespace).
611 611
         for ($y = $out['min_year']; $y <= $out['max_year']; $y++) {
612 612
             for ($m = 1; $m <= 12; $m++) {
613 613
                 foreach ($out['totals'] as $nsId => &$total) {
614
-                    if (!isset($total[$y . $m])) {
615
-                        $total[$y . $m] = 0;
614
+                    if (!isset($total[$y.$m])) {
615
+                        $total[$y.$m] = 0;
616 616
                     }
617 617
                 }
618 618
             }
@@ -672,8 +672,8 @@  discard block
 block discarded – undo
672 672
                 ->globalEditCounts($this->user, $this->project);
673 673
             if ($sorted) {
674 674
                 // Sort.
675
-                uasort($this->globalEditCounts, function ($a, $b) {
676
-                    return $b['total'] - $a['total'];
675
+                uasort($this->globalEditCounts, function($a, $b) {
676
+                    return $b['total']-$a['total'];
677 677
                 });
678 678
             }
679 679
         }
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
             foreach ($revisions as &$revision) {
705 705
                 $nsName = $otherProject->getNamespaces()[$revision['page_namespace']];
706 706
                 $page = $otherProject->getRepository()
707
-                    ->getPage($otherProject, $nsName . ':' . $revision['page_title']);
707
+                    ->getPage($otherProject, $nsName.':'.$revision['page_title']);
708 708
                 $edit = new Edit($page, $revision);
709 709
 
710 710
                 // If we've already got enough, only check for those newer than the current oldest.
Please login to merge, or discard this patch.