Completed
Pull Request — master (#102)
by Matthew
02:21
created
src/AppBundle/Twig/Extension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
         }
58 58
 
59 59
         // Find the path, and complain if English doesn't exist.
60
-        $path = $this->container->getParameter('kernel.root_dir') . '/../i18n';
60
+        $path = $this->container->getParameter('kernel.root_dir').'/../i18n';
61 61
         if (!file_exists("$path/en.json")) {
62 62
             throw new Exception("Language directory doesn't exist: $path");
63 63
         }
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']),
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     public function requestTime()
86 86
     {
87 87
         if (!isset($this->requestTime)) {
88
-            $this->requestTime = microtime(true) - $this->getCurrentRequest()->server->get('REQUEST_TIME_FLOAT');
88
+            $this->requestTime = microtime(true)-$this->getCurrentRequest()->server->get('REQUEST_TIME_FLOAT');
89 89
         }
90 90
 
91 91
         return $this->requestTime;
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     public function intuitionMessage($message = "", $vars = [])
160 160
     {
161
-        return $this->getIntuition()->msg($message, [ "domain" => "xtools", "variables" => $vars ]);
161
+        return $this->getIntuition()->msg($message, ["domain" => "xtools", "variables" => $vars]);
162 162
     }
163 163
 
164 164
     /**
@@ -187,10 +187,10 @@  discard block
 block discarded – undo
187 187
      */
188 188
     public function getAllLangs()
189 189
     {
190
-        $messageFiles = glob($this->container->getParameter("kernel.root_dir") . '/../i18n/*.json');
190
+        $messageFiles = glob($this->container->getParameter("kernel.root_dir").'/../i18n/*.json');
191 191
 
192 192
         $languages = array_values(array_unique(array_map(
193
-            function ($filename) {
193
+            function($filename) {
194 194
                 return basename($filename, '.json');
195 195
             },
196 196
             $messageFiles
@@ -537,9 +537,9 @@  discard block
 block discarded – undo
537 537
     public function getFilters()
538 538
     {
539 539
         return [
540
-            new \Twig_SimpleFilter('capitalize_first', [ $this, 'capitalizeFirst' ]),
541
-            new \Twig_SimpleFilter('percent_format', [ $this, 'percentFormat' ]),
542
-            new \Twig_SimpleFilter('diff_format', [ $this, 'diffFormat' ], [ 'is_safe' => [ 'html' ] ]),
540
+            new \Twig_SimpleFilter('capitalize_first', [$this, 'capitalizeFirst']),
541
+            new \Twig_SimpleFilter('percent_format', [$this, 'percentFormat']),
542
+            new \Twig_SimpleFilter('diff_format', [$this, 'diffFormat'], ['is_safe' => ['html']]),
543 543
             new \Twig_SimpleFilter('num_format', [$this, 'numberFormat']),
544 544
             new \Twig_SimpleFilter('date_format', [$this, 'dateFormat']),
545 545
         ];
@@ -613,10 +613,10 @@  discard block
 block discarded – undo
613 613
         if (!$denominator) {
614 614
             $quotient = $numerator;
615 615
         } else {
616
-            $quotient = ( $numerator / $denominator ) * 100;
616
+            $quotient = ($numerator / $denominator) * 100;
617 617
         }
618 618
 
619
-        return $this->numberFormat($quotient, $precision) . '%';
619
+        return $this->numberFormat($quotient, $precision).'%';
620 620
     }
621 621
 
622 622
     /**
@@ -691,20 +691,20 @@  discard block
 block discarded – undo
691 691
 
692 692
         if ($seconds >= 86400) {
693 693
             // Over a day
694
-            $val = (int) floor($seconds / 86400);
694
+            $val = (int)floor($seconds / 86400);
695 695
             $key = 'days';
696 696
         } elseif ($seconds >= 3600) {
697 697
             // Over an hour, less than a day
698
-            $val = (int) floor($seconds / 3600);
698
+            $val = (int)floor($seconds / 3600);
699 699
             $key = 'hours';
700 700
         } elseif ($seconds >= 60) {
701 701
             // Over a minute, less than an hour
702
-            $val = (int) floor($seconds / 60);
702
+            $val = (int)floor($seconds / 60);
703 703
             $key = 'minutes';
704 704
         }
705 705
 
706 706
         if ($translate) {
707
-            return $this->numberFormat($val) . ' ' . $this->intuitionMessage("num-$key", [$val]);
707
+            return $this->numberFormat($val).' '.$this->intuitionMessage("num-$key", [$val]);
708 708
         } else {
709 709
             return [$this->numberFormat($val), "num-$key"];
710 710
         }
Please login to merge, or discard this patch.
src/Xtools/User.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             $this->getUsername()
90 90
         );
91 91
 
92
-        return (int) $editCount;
92
+        return (int)$editCount;
93 93
     }
94 94
 
95 95
     /**
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function isAnon()
143 143
     {
144
-        return (bool) filter_var($this->username, FILTER_VALIDATE_IP);
144
+        return (bool)filter_var($this->username, FILTER_VALIDATE_IP);
145 145
     }
146 146
 
147 147
     /**
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
      */
205 205
     public function countAutomatedEdits(Project $project, $namespace = 'all', $start = '', $end = '')
206 206
     {
207
-        return (int) $this->getRepository()->countAutomatedEdits($project, $this, $namespace, $start, $end);
207
+        return (int)$this->getRepository()->countAutomatedEdits($project, $this, $namespace, $start, $end);
208 208
     }
209 209
 
210 210
     /**
@@ -236,12 +236,12 @@  discard block
 block discarded – undo
236 236
 
237 237
         $namespaces = $project->getNamespaces();
238 238
 
239
-        return array_map(function ($rev) use ($namespaces) {
239
+        return array_map(function($rev) use ($namespaces) {
240 240
             $pageTitle = $rev['page_title'];
241 241
             $fullPageTitle = '';
242 242
 
243 243
             if ($rev['page_namespace'] !== '0') {
244
-                $fullPageTitle = $namespaces[$rev['page_namespace']] . ":$pageTitle";
244
+                $fullPageTitle = $namespaces[$rev['page_namespace']].":$pageTitle";
245 245
             } else {
246 246
                 $fullPageTitle = $pageTitle;
247 247
             }
@@ -249,12 +249,12 @@  discard block
 block discarded – undo
249 249
             return [
250 250
                 'full_page_title' => $fullPageTitle,
251 251
                 'page_title' => $pageTitle,
252
-                'page_namespace' => (int) $rev['page_namespace'],
253
-                'rev_id' => (int) $rev['rev_id'],
252
+                'page_namespace' => (int)$rev['page_namespace'],
253
+                'rev_id' => (int)$rev['rev_id'],
254 254
                 'timestamp' => DateTime::createFromFormat('YmdHis', $rev['timestamp']),
255
-                'minor' => (bool) $rev['minor'],
256
-                'length' => (int) $rev['length'],
257
-                'length_change' => (int) $rev['length_change'],
255
+                'minor' => (bool)$rev['minor'],
256
+                'length' => (int)$rev['length'],
257
+                'length_change' => (int)$rev['length_change'],
258 258
                 'comment' => $rev['comment'],
259 259
             ];
260 260
         }, $revs);
Please login to merge, or discard this patch.