Completed
Push — master ( d2bafa...7405dd )
by
unknown
02:55
created
src/Xtools/EditCounter.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     protected function getPairData()
63 63
     {
64
-        if (! is_array($this->pairData)) {
64
+        if (!is_array($this->pairData)) {
65 65
             $this->pairData = $this->getRepository()
66 66
                 ->getPairData($this->project, $this->user);
67 67
         }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      */
75 75
     protected function getLogCounts()
76 76
     {
77
-        if (! is_array($this->logCounts)) {
77
+        if (!is_array($this->logCounts)) {
78 78
             $this->logCounts = $this->getRepository()
79 79
                 ->getLogCounts($this->project, $this->user);
80 80
         }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
      */
124 124
     public function countAllRevisions()
125 125
     {
126
-        return $this->countLiveRevisions() + $this->countDeletedRevisions();
126
+        return $this->countLiveRevisions()+$this->countDeletedRevisions();
127 127
     }
128 128
 
129 129
     /**
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      */
143 143
     public function countRevisionsWithoutComments()
144 144
     {
145
-        return $this->countAllRevisions() - $this->countRevisionsWithComments();
145
+        return $this->countAllRevisions()-$this->countRevisionsWithComments();
146 146
     }
147 147
 
148 148
     /**
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
      */
213 213
     public function countAllPagesEdited()
214 214
     {
215
-        return $this->countLivePagesEdited() + $this->countDeletedPagesEdited();
215
+        return $this->countLivePagesEdited()+$this->countDeletedPagesEdited();
216 216
     }
217 217
 
218 218
     /**
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
      */
223 223
     public function countPagesCreated()
224 224
     {
225
-        return $this->countCreatedPagesLive() + $this->countPagesCreatedDeleted();
225
+        return $this->countCreatedPagesLive()+$this->countPagesCreatedDeleted();
226 226
     }
227 227
 
228 228
     /**
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
             // Try block just in case there are older, unpredictable formats
351 351
             try {
352 352
                 $expiry = strtotime($durationStr, $timestamp);
353
-                $duration = ($expiry - $timestamp) / (60 * 60 * 24);
353
+                $duration = ($expiry-$timestamp) / (60 * 60 * 24);
354 354
 
355 355
                 if (!$duration || $duration > $this->longestBlockDays) {
356 356
                     $this->longestBlockDays = $duration;
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
         $import = isset($logCounts['import-import']) ? (int)$logCounts['import-import'] : 0;
435 435
         $interwiki = isset($logCounts['import-interwiki']) ? (int)$logCounts['import-interwiki'] : 0;
436 436
         $upload = isset($logCounts['import-upload']) ? (int)$logCounts['import-upload'] : 0;
437
-        return $import + $interwiki + $upload;
437
+        return $import+$interwiki+$upload;
438 438
     }
439 439
 
440 440
     /**
@@ -567,9 +567,9 @@  discard block
 block discarded – undo
567 567
     public function approvals()
568 568
     {
569 569
         $logCounts = $this->getLogCounts();
570
-        $total = $logCounts['review-approve'] +
571
-        (!empty($logCounts['review-approve-a']) ? $logCounts['review-approve-a'] : 0) +
572
-        (!empty($logCounts['review-approve-i']) ? $logCounts['review-approve-i'] : 0) +
570
+        $total = $logCounts['review-approve']+
571
+        (!empty($logCounts['review-approve-a']) ? $logCounts['review-approve-a'] : 0)+
572
+        (!empty($logCounts['review-approve-i']) ? $logCounts['review-approve-i'] : 0)+
573 573
         (!empty($logCounts['review-approve-ia']) ? $logCounts['review-approve-ia'] : 0);
574 574
         return $total;
575 575
     }
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
         $logCounts = $this->getLogCounts();
594 594
         $create2 = $logCounts['newusers-create2'] ?: 0;
595 595
         $byemail = $logCounts['newusers-byemail'] ?: 0;
596
-        return $create2 + $byemail;
596
+        return $create2+$byemail;
597 597
     }
598 598
 
599 599
     /**
@@ -663,14 +663,14 @@  discard block
 block discarded – undo
663 663
             if (!isset($out['totals'][$ns])) {
664 664
                 $out['totals'][$ns] = [];
665 665
             }
666
-            $out['totals'][$ns][$total['year'] . $total['month']] = $total['count'];
666
+            $out['totals'][$ns][$total['year'].$total['month']] = $total['count'];
667 667
         }
668 668
         // Fill in the blanks (where no edits were made in a given month for a namespace).
669 669
         for ($y = $out['min_year']; $y <= $out['max_year']; $y++) {
670 670
             for ($m = 1; $m <= 12; $m++) {
671 671
                 foreach ($out['totals'] as $nsId => &$total) {
672
-                    if (!isset($total[$y . $m])) {
673
-                        $total[$y . $m] = 0;
672
+                    if (!isset($total[$y.$m])) {
673
+                        $total[$y.$m] = 0;
674 674
                     }
675 675
                 }
676 676
             }
@@ -732,8 +732,8 @@  discard block
 block discarded – undo
732 732
                 ->globalEditCounts($this->user, $this->project);
733 733
             if ($sorted) {
734 734
                 // Sort.
735
-                uasort($this->globalEditCounts, function ($a, $b) {
736
-                    return $b['total'] - $a['total'];
735
+                uasort($this->globalEditCounts, function($a, $b) {
736
+                    return $b['total']-$a['total'];
737 737
                 });
738 738
             }
739 739
         }
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
                 $nsName = $project->getNamespaces()[$revision['page_namespace']];
772 772
             }
773 773
             $page = $project->getRepository()
774
-                ->getPage($project, $nsName . ':' . $revision['page_title']);
774
+                ->getPage($project, $nsName.':'.$revision['page_title']);
775 775
             $edit = new Edit($page, $revision);
776 776
             $globalEdits[$edit->getTimestamp()->getTimestamp().'-'.$edit->getId()] = $edit;
777 777
         }
Please login to merge, or discard this patch.