Passed
Pull Request — master (#128)
by Matthew
03:31
created
src/Xtools/UserRepository.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -262,8 +262,8 @@  discard block
 block discarded – undo
262 262
                 FROM $pageTable
263 263
                 JOIN $revisionTable ON page_id = rev_page
264 264
                 $paJoin
265
-                WHERE $whereRev AND rev_parent_id = '0' $namespaceConditionRev $redirectCondition" .
266
-                ($hasPageAssessments ? 'GROUP BY rev_page' : '') . "
265
+                WHERE $whereRev AND rev_parent_id = '0' $namespaceConditionRev $redirectCondition".
266
+                ($hasPageAssessments ? 'GROUP BY rev_page' : '')."
267 267
             )
268 268
 
269 269
             UNION
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
             $tagJoin = $tags != '' ? "LEFT OUTER JOIN $tagTable ON ct_rev_id = rev_id" : '';
376 376
             $condTools[] = "ct_tag IN ($tags)";
377 377
         }
378
-        $condTool = 'AND (' . implode(' OR ', $condTools) . ')';
378
+        $condTool = 'AND ('.implode(' OR ', $condTools).')';
379 379
 
380 380
         $sql = "SELECT COUNT(DISTINCT(rev_id))
381 381
                 FROM $revisionTable
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
                 $condEnd";
389 389
 
390 390
         $resultQuery = $this->executeQuery($sql, $user, $namespace, $start, $end);
391
-        $result = (int) $resultQuery->fetchColumn();
391
+        $result = (int)$resultQuery->fetchColumn();
392 392
 
393 393
         // Cache for 10 minutes, and return.
394 394
         $cacheItem = $this->cache->getItem($cacheKey)
@@ -524,8 +524,8 @@  discard block
 block discarded – undo
524 524
         }
525 525
 
526 526
         // Sort the array by count
527
-        uasort($results, function ($a, $b) {
528
-            return $b['count'] - $a['count'];
527
+        uasort($results, function($a, $b) {
528
+            return $b['count']-$a['count'];
529 529
         });
530 530
 
531 531
         // Cache for 10 minutes, and return.
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 
575 575
             // Developer error, no regex or tag provided for this tool.
576 576
             if ($condTool === '') {
577
-                throw new Exception("No regex or tag found for the tool $toolname. " .
577
+                throw new Exception("No regex or tag found for the tool $toolname. ".
578 578
                     "Please verify this entry in semi_automated.yml");
579 579
             }
580 580
 
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
             if ($condTool === '') {
623 623
                 $condTool = "ct_tag = $tag";
624 624
             } else {
625
-                $condTool = '(' . $condTool . " OR ct_tag = $tag)";
625
+                $condTool = '('.$condTool." OR ct_tag = $tag)";
626 626
             }
627 627
         }
628 628
 
Please login to merge, or discard this patch.
src/Xtools/EditCounter.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
             $promises[] = $promise;
118 118
 
119 119
             // Handle response of $promise asynchronously.
120
-            $promise->then(function ($response) use ($key, $endpoint) {
121
-                $result = (array) json_decode($response->getBody()->getContents());
120
+            $promise->then(function($response) use ($key, $endpoint) {
121
+                $result = (array)json_decode($response->getBody()->getContents());
122 122
 
123 123
                 $this->getRepository()
124 124
                     ->getLog()
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
                     // We'll log this to see how often it happens.
136 136
                     $this->getRepository()
137 137
                         ->getLog()
138
-                        ->error("Failed to fetch data for $endpoint via async, " .
138
+                        ->error("Failed to fetch data for $endpoint via async, ".
139 139
                             "re-attempting synchoronously.");
140 140
                 }
141 141
             });
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
         // Filter out unblocks unless requested.
193 193
         if ($blocksOnly) {
194
-            $blocks = array_filter($blocks, function ($block) {
194
+            $blocks = array_filter($blocks, function($block) {
195 195
                 return $block['log_action'] === 'block';
196 196
             });
197 197
         }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
      */
226 226
     public function countAllRevisions()
227 227
     {
228
-        return $this->countLiveRevisions() + $this->countDeletedRevisions();
228
+        return $this->countLiveRevisions()+$this->countDeletedRevisions();
229 229
     }
230 230
 
231 231
     /**
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
      */
245 245
     public function countRevisionsWithoutComments()
246 246
     {
247
-        return $this->countLiveRevisions() - $this->countRevisionsWithComments();
247
+        return $this->countLiveRevisions()-$this->countRevisionsWithComments();
248 248
     }
249 249
 
250 250
     /**
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
      */
284 284
     public function countAllPagesEdited()
285 285
     {
286
-        return $this->countLivePagesEdited() + $this->countDeletedPagesEdited();
286
+        return $this->countLivePagesEdited()+$this->countDeletedPagesEdited();
287 287
     }
288 288
 
289 289
     /**
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
      */
294 294
     public function countPagesCreated()
295 295
     {
296
-        return $this->countCreatedPagesLive() + $this->countPagesCreatedDeleted();
296
+        return $this->countCreatedPagesLive()+$this->countPagesCreatedDeleted();
297 297
     }
298 298
 
299 299
     /**
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
             } elseif ($block['log_action'] === 'unblock') {
434 434
                 // The last block was lifted. So the duration will be the time from when the
435 435
                 // last block was set to the time of the unblock.
436
-                $timeSinceLastBlock = $timestamp - $lastBlock[0];
436
+                $timeSinceLastBlock = $timestamp-$lastBlock[0];
437 437
                 if ($timeSinceLastBlock > $this->longestBlockSeconds) {
438 438
                     $this->longestBlockSeconds = $timeSinceLastBlock;
439 439
 
@@ -444,8 +444,8 @@  discard block
 block discarded – undo
444 444
                 // The last block was modified. So we will adjust $lastBlock to include
445 445
                 // the difference of the duration of the new reblock, and time since the last block.
446 446
                 // $lastBlock is left unchanged if its duration was indefinite.
447
-                $timeSinceLastBlock = $timestamp - $lastBlock[0];
448
-                $lastBlock[1] = $timeSinceLastBlock + $duration;
447
+                $timeSinceLastBlock = $timestamp-$lastBlock[0];
448
+                $lastBlock[1] = $timeSinceLastBlock+$duration;
449 449
             }
450 450
         }
451 451
 
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
         }
456 456
 
457 457
         // Test if the last block is still active, and if so use the expiry as the duration.
458
-        $lastBlockExpiry = $lastBlock[0] + $lastBlock[1];
458
+        $lastBlockExpiry = $lastBlock[0]+$lastBlock[1];
459 459
         if ($lastBlockExpiry > time() && $lastBlockExpiry > $this->longestBlockSeconds) {
460 460
             $this->longestBlockSeconds = $lastBlock[1];
461 461
         // Otherwise, test if the duration of the last block is now the longest overall.
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
         // If invalid, $duration is left as null.
497 497
         if (strtotime($durationStr)) {
498 498
             $expiry = strtotime($durationStr, $timestamp);
499
-            $duration = $expiry - $timestamp;
499
+            $duration = $expiry-$timestamp;
500 500
         }
501 501
 
502 502
         return [$timestamp, $duration];
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
         $import = isset($logCounts['import-import']) ? (int)$logCounts['import-import'] : 0;
574 574
         $interwiki = isset($logCounts['import-interwiki']) ? (int)$logCounts['import-interwiki'] : 0;
575 575
         $upload = isset($logCounts['import-upload']) ? (int)$logCounts['import-upload'] : 0;
576
-        return $import + $interwiki + $upload;
576
+        return $import+$interwiki+$upload;
577 577
     }
578 578
 
579 579
     /**
@@ -697,9 +697,9 @@  discard block
 block discarded – undo
697 697
     public function approvals()
698 698
     {
699 699
         $logCounts = $this->getLogCounts();
700
-        $total = $logCounts['review-approve'] +
701
-        (!empty($logCounts['review-approve-a']) ? $logCounts['review-approve-a'] : 0) +
702
-        (!empty($logCounts['review-approve-i']) ? $logCounts['review-approve-i'] : 0) +
700
+        $total = $logCounts['review-approve']+
701
+        (!empty($logCounts['review-approve-a']) ? $logCounts['review-approve-a'] : 0)+
702
+        (!empty($logCounts['review-approve-i']) ? $logCounts['review-approve-i'] : 0)+
703 703
         (!empty($logCounts['review-approve-ia']) ? $logCounts['review-approve-ia'] : 0);
704 704
         return $total;
705 705
     }
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
         $logCounts = $this->getLogCounts();
724 724
         $create2 = $logCounts['newusers-create2'] ?: 0;
725 725
         $byemail = $logCounts['newusers-byemail'] ?: 0;
726
-        return $create2 + $byemail;
726
+        return $create2+$byemail;
727 727
     }
728 728
 
729 729
     /**
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
 
776 776
         $totals = $this->getRepository()->getMonthCounts($this->project, $this->user);
777 777
         $out = [
778
-            'yearLabels' => [],  // labels for years
778
+            'yearLabels' => [], // labels for years
779 779
             'monthLabels' => [], // labels for months
780 780
             'totals' => [], // actual totals, grouped by namespace, year and then month
781 781
         ];
@@ -842,7 +842,7 @@  discard block
 block discarded – undo
842 842
                 $out['totals'][$ns][$total['year']] = [];
843 843
             }
844 844
 
845
-            $out['totals'][$ns][$total['year']][$total['month']] = (int) $total['count'];
845
+            $out['totals'][$ns][$total['year']][$total['month']] = (int)$total['count'];
846 846
         }
847 847
 
848 848
         return [$out, $firstEdit];
@@ -859,8 +859,8 @@  discard block
 block discarded – undo
859 859
     private function fillInMonthTotalsAndLabels($out, DatePeriod $dateRange)
860 860
     {
861 861
         foreach ($dateRange as $monthObj) {
862
-            $year = (int) $monthObj->format('Y');
863
-            $month = (int) $monthObj->format('n');
862
+            $year = (int)$monthObj->format('Y');
863
+            $month = (int)$monthObj->format('n');
864 864
 
865 865
             // Fill in labels
866 866
             $out['monthLabels'][] = $monthObj->format('Y-m');
@@ -963,8 +963,8 @@  discard block
 block discarded – undo
963 963
 
964 964
         if ($sorted) {
965 965
             // Sort.
966
-            uasort($this->globalEditCounts, function ($a, $b) {
967
-                return $b['total'] - $a['total'];
966
+            uasort($this->globalEditCounts, function($a, $b) {
967
+                return $b['total']-$a['total'];
968 968
             });
969 969
         }
970 970
 
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
                 $nsName = $project->getNamespaces()[$revision['page_namespace']];
1001 1001
             }
1002 1002
             $page = $project->getRepository()
1003
-                ->getPage($project, $nsName . ':' . $revision['page_title']);
1003
+                ->getPage($project, $nsName.':'.$revision['page_title']);
1004 1004
             $edit = new Edit($page, $revision);
1005 1005
             $globalEdits[$edit->getTimestamp()->getTimestamp().'-'.$edit->getId()] = $edit;
1006 1006
         }
@@ -1041,7 +1041,7 @@  discard block
 block discarded – undo
1041 1041
     public function countSmallEdits()
1042 1042
     {
1043 1043
         $editSizeData = $this->getEditSizeData();
1044
-        return isset($editSizeData['small_edits']) ? (int) $editSizeData['small_edits'] : 0;
1044
+        return isset($editSizeData['small_edits']) ? (int)$editSizeData['small_edits'] : 0;
1045 1045
     }
1046 1046
 
1047 1047
     /**
@@ -1051,7 +1051,7 @@  discard block
 block discarded – undo
1051 1051
     public function countLargeEdits()
1052 1052
     {
1053 1053
         $editSizeData = $this->getEditSizeData();
1054
-        return isset($editSizeData['large_edits']) ? (int) $editSizeData['large_edits'] : 0;
1054
+        return isset($editSizeData['large_edits']) ? (int)$editSizeData['large_edits'] : 0;
1055 1055
     }
1056 1056
 
1057 1057
     /**
Please login to merge, or discard this patch.
src/AppBundle/Controller/DefaultController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     public function loginAction()
90 90
     {
91 91
         try {
92
-            list( $next, $token ) = $this->getOauthClient()->initiate();
92
+            list($next, $token) = $this->getOauthClient()->initiate();
93 93
         } catch (Exception $oauthException) {
94 94
             throw $oauthException;
95 95
             // @TODO Make this work.
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
                     . '?title=Special:OAuth';
157 157
         $conf = new ClientConfig($endpoint);
158 158
         $consumerKey = $this->getParameter('oauth_key');
159
-        $consumerSecret =  $this->getParameter('oauth_secret');
159
+        $consumerSecret = $this->getParameter('oauth_secret');
160 160
         $conf->setConsumer(new Consumer($consumerKey, $consumerSecret));
161 161
         $this->oauthClient = new Client($conf);
162 162
         // Callback URL is hardcoded in the consumer registration.
Please login to merge, or discard this patch.
src/AppBundle/Helper/ApiHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             $normalized = [];
77 77
             if (isset($result['query']['normalized'])) {
78 78
                 array_map(
79
-                    function ($e) use (&$normalized) {
79
+                    function($e) use (&$normalized) {
80 80
                         $normalized[$e['to']] = $e['from'];
81 81
                     },
82 82
                     $result['query']['normalized']
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         $query = FluentRequest::factory()->setAction('query')->setParams($requestData);
162 162
         $innerPromise = $this->api->getRequestAsync($query);
163 163
 
164
-        $innerPromise->then(function ($result) use (&$data) {
164
+        $innerPromise->then(function($result) use (&$data) {
165 165
             // some failures come back as 200s, so we still resolve and let the outer function handle it
166 166
             if (isset($result['error']) || !isset($result['query'])) {
167 167
                 return $data['promise']->resolve($data);
Please login to merge, or discard this patch.
src/AppBundle/Twig/AppExtension.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -44,32 +44,32 @@  discard block
 block discarded – undo
44 44
     {
45 45
         $options = ['is_safe' => ['html']];
46 46
         return [
47
-            new \Twig_SimpleFunction('request_time', [ $this, 'requestTime' ], $options),
48
-            new \Twig_SimpleFunction('memory_usage', [ $this, 'requestMemory' ], $options),
49
-            new \Twig_SimpleFunction('year', [ $this, 'generateYear' ], $options),
50
-            new \Twig_SimpleFunction('msgPrintExists', [ $this, 'intuitionMessagePrintExists' ], $options),
51
-            new \Twig_SimpleFunction('msgExists', [ $this, 'intuitionMessageExists' ], $options),
52
-            new \Twig_SimpleFunction('msg', [ $this, 'intuitionMessage' ], $options),
53
-            new \Twig_SimpleFunction('lang', [ $this, 'getLang' ], $options),
54
-            new \Twig_SimpleFunction('langName', [ $this, 'getLangName' ], $options),
55
-            new \Twig_SimpleFunction('allLangs', [ $this, 'getAllLangs' ]),
56
-            new \Twig_SimpleFunction('isRTL', [ $this, 'intuitionIsRTL' ]),
57
-            new \Twig_SimpleFunction('isRTLLang', [ $this, 'intuitionIsRTLLang' ]),
58
-            new \Twig_SimpleFunction('shortHash', [ $this, 'gitShortHash' ]),
59
-            new \Twig_SimpleFunction('hash', [ $this, 'gitHash' ]),
60
-            new \Twig_SimpleFunction('releaseDate', [ $this, 'gitDate' ]),
61
-            new \Twig_SimpleFunction('enabled', [ $this, 'tabEnabled' ]),
62
-            new \Twig_SimpleFunction('tools', [ $this, 'allTools' ]),
63
-            new \Twig_SimpleFunction('color', [ $this, 'getColorList' ]),
64
-            new \Twig_SimpleFunction('chartColor', [ $this, 'chartColor' ]),
65
-            new \Twig_SimpleFunction('isSingleWiki', [ $this, 'isSingleWiki' ]),
66
-            new \Twig_SimpleFunction('getReplagThreshold', [ $this, 'getReplagThreshold' ]),
67
-            new \Twig_SimpleFunction('loadStylesheetsFromCDN', [ $this, 'loadStylesheetsFromCDN' ]),
68
-            new \Twig_SimpleFunction('isWMFLabs', [ $this, 'isWMFLabs' ]),
69
-            new \Twig_SimpleFunction('replag', [ $this, 'replag' ]),
70
-            new \Twig_SimpleFunction('link', [ $this, 'link' ]),
71
-            new \Twig_SimpleFunction('quote', [ $this, 'quote' ]),
72
-            new \Twig_SimpleFunction('bugReportURL', [ $this, 'bugReportURL' ]),
47
+            new \Twig_SimpleFunction('request_time', [$this, 'requestTime'], $options),
48
+            new \Twig_SimpleFunction('memory_usage', [$this, 'requestMemory'], $options),
49
+            new \Twig_SimpleFunction('year', [$this, 'generateYear'], $options),
50
+            new \Twig_SimpleFunction('msgPrintExists', [$this, 'intuitionMessagePrintExists'], $options),
51
+            new \Twig_SimpleFunction('msgExists', [$this, 'intuitionMessageExists'], $options),
52
+            new \Twig_SimpleFunction('msg', [$this, 'intuitionMessage'], $options),
53
+            new \Twig_SimpleFunction('lang', [$this, 'getLang'], $options),
54
+            new \Twig_SimpleFunction('langName', [$this, 'getLangName'], $options),
55
+            new \Twig_SimpleFunction('allLangs', [$this, 'getAllLangs']),
56
+            new \Twig_SimpleFunction('isRTL', [$this, 'intuitionIsRTL']),
57
+            new \Twig_SimpleFunction('isRTLLang', [$this, 'intuitionIsRTLLang']),
58
+            new \Twig_SimpleFunction('shortHash', [$this, 'gitShortHash']),
59
+            new \Twig_SimpleFunction('hash', [$this, 'gitHash']),
60
+            new \Twig_SimpleFunction('releaseDate', [$this, 'gitDate']),
61
+            new \Twig_SimpleFunction('enabled', [$this, 'tabEnabled']),
62
+            new \Twig_SimpleFunction('tools', [$this, 'allTools']),
63
+            new \Twig_SimpleFunction('color', [$this, 'getColorList']),
64
+            new \Twig_SimpleFunction('chartColor', [$this, 'chartColor']),
65
+            new \Twig_SimpleFunction('isSingleWiki', [$this, 'isSingleWiki']),
66
+            new \Twig_SimpleFunction('getReplagThreshold', [$this, 'getReplagThreshold']),
67
+            new \Twig_SimpleFunction('loadStylesheetsFromCDN', [$this, 'loadStylesheetsFromCDN']),
68
+            new \Twig_SimpleFunction('isWMFLabs', [$this, 'isWMFLabs']),
69
+            new \Twig_SimpleFunction('replag', [$this, 'replag']),
70
+            new \Twig_SimpleFunction('link', [$this, 'link']),
71
+            new \Twig_SimpleFunction('quote', [$this, 'quote']),
72
+            new \Twig_SimpleFunction('bugReportURL', [$this, 'bugReportURL']),
73 73
             new \Twig_SimpleFunction('logged_in_user', [$this, 'functionLoggedInUser']),
74 74
             new \Twig_SimpleFunction('isUserAnon', [$this, 'isUserAnon']),
75 75
             new \Twig_SimpleFunction('nsName', [$this, 'nsName']),
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     public function requestTime()
88 88
     {
89 89
         if (!isset($this->requestTime)) {
90
-            $this->requestTime = microtime(true) - $this->getCurrentRequest()->server->get('REQUEST_TIME_FLOAT');
90
+            $this->requestTime = microtime(true)-$this->getCurrentRequest()->server->get('REQUEST_TIME_FLOAT');
91 91
         }
92 92
 
93 93
         return $this->requestTime;
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      */
161 161
     public function intuitionMessage($message = "", $vars = [])
162 162
     {
163
-        return $this->getIntuition()->msg($message, [ "domain" => "xtools", "variables" => $vars ]);
163
+        return $this->getIntuition()->msg($message, ["domain" => "xtools", "variables" => $vars]);
164 164
     }
165 165
 
166 166
     /**
@@ -189,10 +189,10 @@  discard block
 block discarded – undo
189 189
      */
190 190
     public function getAllLangs()
191 191
     {
192
-        $messageFiles = glob($this->container->getParameter("kernel.root_dir") . '/../i18n/*.json');
192
+        $messageFiles = glob($this->container->getParameter("kernel.root_dir").'/../i18n/*.json');
193 193
 
194 194
         $languages = array_values(array_unique(array_map(
195
-            function ($filename) {
195
+            function($filename) {
196 196
                 return basename($filename, '.json');
197 197
             },
198 198
             $messageFiles
@@ -540,9 +540,9 @@  discard block
 block discarded – undo
540 540
     public function getFilters()
541 541
     {
542 542
         return [
543
-            new \Twig_SimpleFilter('capitalize_first', [ $this, 'capitalizeFirst' ]),
544
-            new \Twig_SimpleFilter('percent_format', [ $this, 'percentFormat' ]),
545
-            new \Twig_SimpleFilter('diff_format', [ $this, 'diffFormat' ], [ 'is_safe' => [ 'html' ] ]),
543
+            new \Twig_SimpleFilter('capitalize_first', [$this, 'capitalizeFirst']),
544
+            new \Twig_SimpleFilter('percent_format', [$this, 'percentFormat']),
545
+            new \Twig_SimpleFilter('diff_format', [$this, 'diffFormat'], ['is_safe' => ['html']]),
546 546
             new \Twig_SimpleFilter('num_format', [$this, 'numberFormat']),
547 547
             new \Twig_SimpleFilter('date_format', [$this, 'dateFormat']),
548 548
         ];
@@ -616,10 +616,10 @@  discard block
 block discarded – undo
616 616
         if (!$denominator) {
617 617
             $quotient = $numerator;
618 618
         } else {
619
-            $quotient = ( $numerator / $denominator ) * 100;
619
+            $quotient = ($numerator / $denominator) * 100;
620 620
         }
621 621
 
622
-        return $this->numberFormat($quotient, $precision) . '%';
622
+        return $this->numberFormat($quotient, $precision).'%';
623 623
     }
624 624
 
625 625
     /**
@@ -689,7 +689,7 @@  discard block
 block discarded – undo
689 689
         list($val, $key) = $this->getDurationMessageKey($seconds);
690 690
 
691 691
         if ($translate) {
692
-            return $this->numberFormat($val) . ' ' . $this->intuitionMessage("num-$key", [$val]);
692
+            return $this->numberFormat($val).' '.$this->intuitionMessage("num-$key", [$val]);
693 693
         } else {
694 694
             return [$this->numberFormat($val), "num-$key"];
695 695
         }
@@ -710,15 +710,15 @@  discard block
 block discarded – undo
710 710
 
711 711
         if ($seconds >= 86400) {
712 712
             // Over a day
713
-            $val = (int) floor($seconds / 86400);
713
+            $val = (int)floor($seconds / 86400);
714 714
             $key = 'days';
715 715
         } elseif ($seconds >= 3600) {
716 716
             // Over an hour, less than a day
717
-            $val = (int) floor($seconds / 3600);
717
+            $val = (int)floor($seconds / 3600);
718 718
             $key = 'hours';
719 719
         } elseif ($seconds >= 60) {
720 720
             // Over a minute, less than an hour
721
-            $val = (int) floor($seconds / 60);
721
+            $val = (int)floor($seconds / 60);
722 722
             $key = 'minutes';
723 723
         }
724 724
 
Please login to merge, or discard this patch.
src/Xtools/Page.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $info = $this->getPageInfo();
93 93
         $title = isset($info['title']) ? $info['title'] : $this->unnormalizedPageName;
94 94
         $nsName = $this->getNamespaceName();
95
-        return str_replace($nsName . ':', '', $title);
95
+        return str_replace($nsName.':', '', $title);
96 96
     }
97 97
 
98 98
     /**
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     {
229 229
         // If a user is given, we will not cache the result via instance variable.
230 230
         if ($user !== null) {
231
-            return (int) $this->getRepository()->getNumRevisions($this, $user);
231
+            return (int)$this->getRepository()->getNumRevisions($this, $user);
232 232
         }
233 233
 
234 234
         // Return cached value, if present.
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
             $this->numRevisions = count($this->revisions);
242 242
         } else {
243 243
             // Otherwise do a COUNT in the event fetching all revisions is not desired.
244
-            $this->numRevisions = (int) $this->getRepository()->getNumRevisions($this);
244
+            $this->numRevisions = (int)$this->getRepository()->getNumRevisions($this);
245 245
         }
246 246
 
247 247
         return $this->numRevisions;
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
     {
272 272
         $content = $this->getRepository()->getPagesWikitext(
273 273
             $this->getProject(),
274
-            [ $this->getTitle() ]
274
+            [$this->getTitle()]
275 275
         );
276 276
 
277 277
         return isset($content[$this->getTitle()])
@@ -533,8 +533,8 @@  discard block
 block discarded – undo
533 533
             return 0;
534 534
         }
535 535
 
536
-        return array_sum(array_map(function ($item) {
537
-            return (int) $item['views'];
536
+        return array_sum(array_map(function($item) {
537
+            return (int)$item['views'];
538 538
         }, $pageviews['items']));
539 539
     }
540 540
 
Please login to merge, or discard this patch.
src/AppBundle/Controller/MetaController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         $timeline = [];
80 80
         $startObj = new DateTime($start);
81 81
         $endObj = new DateTime($end);
82
-        $numDays = (int) $endObj->diff($startObj)->format("%a");
82
+        $numDays = (int)$endObj->diff($startObj)->format("%a");
83 83
         $grandSum = 0;
84 84
 
85 85
         // Generate array of date labels
@@ -93,17 +93,17 @@  discard block
 block discarded – undo
93 93
 
94 94
         foreach ($data as $entry) {
95 95
             if (!isset($totals[$entry['tool']])) {
96
-                $totals[$entry['tool']] = (int) $entry['count'];
96
+                $totals[$entry['tool']] = (int)$entry['count'];
97 97
 
98 98
                 // Create arrays for each tool, filled with zeros for each date in the timeline
99 99
                 $timeline[$entry['tool']] = array_fill(0, $numDays, 0);
100 100
             } else {
101
-                $totals[$entry['tool']] += (int) $entry['count'];
101
+                $totals[$entry['tool']] += (int)$entry['count'];
102 102
             }
103 103
 
104 104
             $date = new DateTime($entry['date']);
105
-            $dateIndex = (int) $date->diff($startObj)->format("%a");
106
-            $timeline[$entry['tool']][$dateIndex] = (int) $entry['count'];
105
+            $dateIndex = (int)$date->diff($startObj)->format("%a");
106
+            $timeline[$entry['tool']][$dateIndex] = (int)$entry['count'];
107 107
 
108 108
             $grandSum += $entry['count'];
109 109
         }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         }
163 163
 
164 164
         $conn = $this->container->get('doctrine')->getManager('default')->getConnection();
165
-        $date =  date('Y-m-d');
165
+        $date = date('Y-m-d');
166 166
 
167 167
         // Increment count in timeline
168 168
         $existsSql = "SELECT 1 FROM usage_timeline
@@ -241,9 +241,9 @@  discard block
 block discarded – undo
241 241
 
242 242
             $releaseNotes = str_replace("# Release Notes #", "", $releaseNotes);
243 243
 
244
-            $releaseNotes = $newReleaseNotes . "\r\n\r\n" . $releaseNotes;
244
+            $releaseNotes = $newReleaseNotes."\r\n\r\n".$releaseNotes;
245 245
 
246
-            $releaseNotes = "## $newVersion ##" . "\r\n" . $releaseNotes;
246
+            $releaseNotes = "## $newVersion ##"."\r\n".$releaseNotes;
247 247
 
248 248
             $releaseNotes = "# Release Notes #\r\n\r\n$releaseNotes";
249 249
 
Please login to merge, or discard this patch.