Completed
Pull Request — master (#13)
by
unknown
03:57
created
src/AppBundle/Controller/TopEditsController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                 'username' => $username,
49 49
             ]);
50 50
         } elseif ($project != "") {
51
-            return $this->redirectToRoute("TopEditsResults", [ 'project'=>$project ]);
51
+            return $this->redirectToRoute("TopEditsResults", ['project'=>$project]);
52 52
         }
53 53
 
54 54
         // replace this example code with whatever you need
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         $editData = $conn->executeQuery($query, $params)->fetchAll();
101 101
 
102 102
         // Get page info about these 100 pages, so we can use their display title.
103
-        $titles = array_map(function ($e) {
103
+        $titles = array_map(function($e) {
104 104
             return $e['page_title'];
105 105
         }, $editData);
106 106
         /** @var ApiHelper $apiHelper */
Please login to merge, or discard this patch.
src/AppBundle/Helper/EditCounterHelper.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     public function getUserId($usernameOrIp)
40 40
     {
41 41
         // Use cache if possible.
42
-        $cacheItem = $this->cache->getItem('ec.usernameOrIp.' . $usernameOrIp);
42
+        $cacheItem = $this->cache->getItem('ec.usernameOrIp.'.$usernameOrIp);
43 43
         if ($cacheItem->isHit()) {
44 44
             return $cacheItem->get();
45 45
         }
@@ -106,24 +106,24 @@  discard block
 block discarded – undo
106 106
         }
107 107
 
108 108
         $revisionCounts = array_combine(
109
-            array_map(function ($e) {
109
+            array_map(function($e) {
110 110
                 return $e['source'];
111 111
             }, $results),
112
-            array_map(function ($e) {
112
+            array_map(function($e) {
113 113
                 return $e['value'];
114 114
             }, $results)
115 115
         );
116 116
 
117 117
         // Count the number of days, accounting for when there's only one edit.
118
-        $editingTimeInSeconds = ceil($revisionCounts['last'] - $revisionCounts['first']);
119
-        $revisionCounts['days'] = $editingTimeInSeconds ? $editingTimeInSeconds/(60*60*24) : 1;
118
+        $editingTimeInSeconds = ceil($revisionCounts['last']-$revisionCounts['first']);
119
+        $revisionCounts['days'] = $editingTimeInSeconds ? $editingTimeInSeconds / (60 * 60 * 24) : 1;
120 120
 
121 121
         // Format the first and last dates.
122 122
         $revisionCounts['first'] = date('Y-m-d H:i', strtotime($revisionCounts['first']));
123 123
         $revisionCounts['last'] = date('Y-m-d H:i', strtotime($revisionCounts['last']));
124 124
 
125 125
         // Sum deleted and live to make the total.
126
-        $revisionCounts['total'] = $revisionCounts['deleted'] + $revisionCounts['live'];
126
+        $revisionCounts['total'] = $revisionCounts['deleted']+$revisionCounts['live'];
127 127
         
128 128
         // Calculate the average number of live edits per day.
129 129
         $revisionCounts['avg_per_day'] = round(
@@ -160,16 +160,16 @@  discard block
 block discarded – undo
160 160
         $results = $resultQuery->fetchAll();
161 161
 
162 162
         $pageCounts = array_combine(
163
-            array_map(function ($e) {
163
+            array_map(function($e) {
164 164
                 return $e['source'];
165 165
             }, $results),
166
-            array_map(function ($e) {
166
+            array_map(function($e) {
167 167
                 return $e['value'];
168 168
             }, $results)
169 169
         );
170 170
 
171 171
         // Total created.
172
-        $pageCounts['created'] = $pageCounts['created-live'] + $pageCounts['created-deleted'];
172
+        $pageCounts['created'] = $pageCounts['created-live']+$pageCounts['created-deleted'];
173 173
 
174 174
         // Calculate the average number of edits per page.
175 175
         $pageCounts['edits_per_page'] = 0;
@@ -196,17 +196,17 @@  discard block
 block discarded – undo
196 196
         $resultQuery->execute();
197 197
         $results = $resultQuery->fetchAll();
198 198
         $logCounts = array_combine(
199
-            array_map(function ($e) {
199
+            array_map(function($e) {
200 200
                 return $e['source'];
201 201
             }, $results),
202
-            array_map(function ($e) {
202
+            array_map(function($e) {
203 203
                 return $e['value'];
204 204
             }, $results)
205 205
         );
206 206
 
207 207
         // Make sure there is some value for each of the wanted counts.
208 208
         $requiredCounts = [
209
-            'thanks-thank', 'review-approve', 'patrol-patrol','block-block', 'block-unblock',
209
+            'thanks-thank', 'review-approve', 'patrol-patrol', 'block-block', 'block-unblock',
210 210
             'protect-protect', 'protect-unprotect', 'delete-delete', 'delete-revision',
211 211
             'delete-restore', 'import-import', 'upload-upload', 'upload-overwrite',
212 212
         ];
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
         }
218 218
 
219 219
         // Merge approvals together.
220
-        $logCounts['review-approve'] = $logCounts['review-approve'] +
221
-            (!empty($logCounts['review-approve-a']) ? $logCounts['review-approve-a'] : 0) +
222
-            (!empty($logCounts['review-approve-i']) ? $logCounts['review-approve-i'] : 0) +
220
+        $logCounts['review-approve'] = $logCounts['review-approve']+
221
+            (!empty($logCounts['review-approve-a']) ? $logCounts['review-approve-a'] : 0)+
222
+            (!empty($logCounts['review-approve-i']) ? $logCounts['review-approve-i'] : 0)+
223 223
             (!empty($logCounts['review-approve-ia']) ? $logCounts['review-approve-ia'] : 0);
224 224
 
225 225
         // Add Commons upload count, if applicable.
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
     public function getNamespaceTotals($userId)
245 245
     {
246 246
         $sql = "SELECT page_namespace, count(rev_id) AS total
247
-            FROM ".$this->labsHelper->getTable('revision') ." r
247
+            FROM ".$this->labsHelper->getTable('revision')." r
248 248
                 JOIN ".$this->labsHelper->getTable('page')." p on r.rev_page = p.page_id
249 249
             WHERE r.rev_user = :id GROUP BY page_namespace";
250 250
         $resultQuery = $this->replicas->prepare($sql);
@@ -252,10 +252,10 @@  discard block
 block discarded – undo
252 252
         $resultQuery->execute();
253 253
         $results = $resultQuery->fetchAll();
254 254
         $namespaceTotals = array_combine(
255
-            array_map(function ($e) {
255
+            array_map(function($e) {
256 256
                 return $e['page_namespace'];
257 257
             }, $results),
258
-            array_map(function ($e) {
258
+            array_map(function($e) {
259 259
                 return $e['total'];
260 260
             }, $results)
261 261
         );
Please login to merge, or discard this patch.
src/AppBundle/Helper/PageviewsHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
         $title = str_replace(' ', '_', $title);
13 13
         $client = new GuzzleHttp\Client();
14 14
 
15
-        $url = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/' .
16
-            "$project/all-access/user/" . rawurlencode($title) . '/daily/' . $start . '/' . $end;
15
+        $url = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/'.
16
+            "$project/all-access/user/".rawurlencode($title).'/daily/'.$start.'/'.$end;
17 17
 
18 18
         $res = $client->request('GET', $url);
19 19
         return json_decode($res->getBody()->getContents());
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
         $data = $this->getLastDays($project, $title, $days);
33 33
 
34 34
         // FIXME: needs to handle gotchas
35
-        return array_sum(array_map(function ($item) {
35
+        return array_sum(array_map(function($item) {
36 36
             return $item->views;
37 37
         }, $data->items));
38 38
     }
Please login to merge, or discard this patch.
src/AppBundle/Twig/Extension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
         }
46 46
 
47 47
         // Find the path, and complain if English doesn't exist.
48
-        $path = $this->container->getParameter("kernel.root_dir") . '/../i18n';
48
+        $path = $this->container->getParameter("kernel.root_dir").'/../i18n';
49 49
         if (!file_exists("$path/en.json")) {
50 50
             throw new Exception("Language directory doesn't exist: $path");
51 51
         }
Please login to merge, or discard this patch.
src/AppBundle/Twig/AppExtension.php 1 patch
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -16,38 +16,38 @@  discard block
 block discarded – undo
16 16
     {
17 17
         $options = ['is_safe' => ['html']];
18 18
         return [
19
-            new \Twig_SimpleFunction('request_time', [ $this, 'requestTime' ], $options),
20
-            new \Twig_SimpleFunction('memory_usage', [ $this, 'requestMemory' ], $options),
21
-            new \Twig_SimpleFunction('year', [ $this, 'generateYear' ], $options),
22
-            new \Twig_SimpleFunction('linkWiki', [ $this, 'linkToWiki' ], $options),
23
-            new \Twig_SimpleFunction('linkWikiScript', [ $this, 'linkToWikiScript' ], $options),
24
-            new \Twig_SimpleFunction('msgPrintExists', [ $this, 'intuitionMessagePrintExists' ], $options),
25
-            new \Twig_SimpleFunction('msgExists', [ $this, 'intuitionMessageExists' ], $options),
26
-            new \Twig_SimpleFunction('msg', [ $this, 'intuitionMessage' ], $options),
27
-            new \Twig_SimpleFunction('msg_footer', [ $this, 'intuitionMessageFooter' ], $options),
28
-            new \Twig_SimpleFunction('lang', [ $this, 'getLang' ], $options),
29
-            new \Twig_SimpleFunction('langName', [ $this, 'getLangName' ], $options),
30
-            new \Twig_SimpleFunction('allLangs', [ $this, 'getAllLangs' ]),
31
-            new \Twig_SimpleFunction('isRTL', [ $this, 'intuitionIsRTL' ]),
32
-            new \Twig_SimpleFunction('shortHash', [ $this, 'gitShortHash' ]),
33
-            new \Twig_SimpleFunction('hash', [ $this, 'gitHash' ]),
34
-            new \Twig_SimpleFunction('enabled', [ $this, 'tabEnabled' ]),
35
-            new \Twig_SimpleFunction('tools', [ $this, 'allTools' ]),
36
-            new \Twig_SimpleFunction('color', [ $this, 'getColorList' ]),
37
-            new \Twig_SimpleFunction('isWMFLabs', [ $this, 'isWMFLabs' ]),
38
-            new \Twig_SimpleFunction('isSingleWiki', [ $this, 'isSingleWiki' ]),
39
-            new \Twig_SimpleFunction('getReplagThreshold', [ $this, 'getReplagThreshold' ]),
40
-            new \Twig_SimpleFunction('loadStylesheetsFromCDN', [ $this, 'loadStylesheetsFromCDN' ]),
41
-            new \Twig_SimpleFunction('isWMFLabs', [ $this, 'isWMFLabs' ]),
42
-            new \Twig_SimpleFunction('replag', [ $this, 'replag' ]),
43
-            new \Twig_SimpleFunction('link', [ $this, 'link' ]),
19
+            new \Twig_SimpleFunction('request_time', [$this, 'requestTime'], $options),
20
+            new \Twig_SimpleFunction('memory_usage', [$this, 'requestMemory'], $options),
21
+            new \Twig_SimpleFunction('year', [$this, 'generateYear'], $options),
22
+            new \Twig_SimpleFunction('linkWiki', [$this, 'linkToWiki'], $options),
23
+            new \Twig_SimpleFunction('linkWikiScript', [$this, 'linkToWikiScript'], $options),
24
+            new \Twig_SimpleFunction('msgPrintExists', [$this, 'intuitionMessagePrintExists'], $options),
25
+            new \Twig_SimpleFunction('msgExists', [$this, 'intuitionMessageExists'], $options),
26
+            new \Twig_SimpleFunction('msg', [$this, 'intuitionMessage'], $options),
27
+            new \Twig_SimpleFunction('msg_footer', [$this, 'intuitionMessageFooter'], $options),
28
+            new \Twig_SimpleFunction('lang', [$this, 'getLang'], $options),
29
+            new \Twig_SimpleFunction('langName', [$this, 'getLangName'], $options),
30
+            new \Twig_SimpleFunction('allLangs', [$this, 'getAllLangs']),
31
+            new \Twig_SimpleFunction('isRTL', [$this, 'intuitionIsRTL']),
32
+            new \Twig_SimpleFunction('shortHash', [$this, 'gitShortHash']),
33
+            new \Twig_SimpleFunction('hash', [$this, 'gitHash']),
34
+            new \Twig_SimpleFunction('enabled', [$this, 'tabEnabled']),
35
+            new \Twig_SimpleFunction('tools', [$this, 'allTools']),
36
+            new \Twig_SimpleFunction('color', [$this, 'getColorList']),
37
+            new \Twig_SimpleFunction('isWMFLabs', [$this, 'isWMFLabs']),
38
+            new \Twig_SimpleFunction('isSingleWiki', [$this, 'isSingleWiki']),
39
+            new \Twig_SimpleFunction('getReplagThreshold', [$this, 'getReplagThreshold']),
40
+            new \Twig_SimpleFunction('loadStylesheetsFromCDN', [$this, 'loadStylesheetsFromCDN']),
41
+            new \Twig_SimpleFunction('isWMFLabs', [$this, 'isWMFLabs']),
42
+            new \Twig_SimpleFunction('replag', [$this, 'replag']),
43
+            new \Twig_SimpleFunction('link', [$this, 'link']),
44 44
         ];
45 45
     }
46 46
 
47 47
     public function requestTime($decimals = 3)
48 48
     {
49 49
 
50
-        return number_format(microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], $decimals);
50
+        return number_format(microtime(true)-$_SERVER['REQUEST_TIME_FLOAT'], $decimals);
51 51
     }
52 52
 
53 53
     public function requestMemory()
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
      */
74 74
     public function linkToWiki($url, $page, $secondary = "")
75 75
     {
76
-        $link = $url . "/";
76
+        $link = $url."/";
77 77
 
78 78
         if ($this->isWMFLabs()) {
79 79
             $link .= "wiki/";
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 
91 91
     public function linkToWikiScript($url, $secondary)
92 92
     {
93
-        $link = $url . "/";
93
+        $link = $url."/";
94 94
 
95 95
         if ($this->isWMFLabs()) {
96 96
             $link .= "w/";
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
     // TODO: refactor all intuition stuff so it can be used anywhere
107 107
     public function intuitionMessageExists($message = "")
108 108
     {
109
-        return $this->getIntuition()->msgExists($message, [ "domain" => "xtools" ]);
109
+        return $this->getIntuition()->msgExists($message, ["domain" => "xtools"]);
110 110
     }
111 111
 
112 112
     public function intuitionMessagePrintExists($message = "", $vars = [])
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
     public function intuitionMessage($message = "", $vars = [])
127 127
     {
128
-        return $this->getIntuition()->msg($message, [ "domain" => "xtools", "variables" => $vars ]);
128
+        return $this->getIntuition()->msg($message, ["domain" => "xtools", "variables" => $vars]);
129 129
     }
130 130
 
131 131
     public function intuitionMessageFooter()
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
      */
154 154
     public function getAllLangs()
155 155
     {
156
-        $messageFiles = glob($this->container->getParameter("kernel.root_dir") . '/../i18n/*.json');
156
+        $messageFiles = glob($this->container->getParameter("kernel.root_dir").'/../i18n/*.json');
157 157
 
158 158
         $languages = array_values(array_unique(array_map(
159
-            function ($filename) {
159
+            function($filename) {
160 160
                 return basename($filename, '.json');
161 161
             },
162 162
             $messageFiles
@@ -208,41 +208,41 @@  discard block
 block discarded – undo
208 208
     public function getColorList($num = false)
209 209
     {
210 210
         $colors = [
211
-            0 => '#Cc0000',# '#FF005A', #red '#FF5555',
211
+            0 => '#Cc0000', # '#FF005A', #red '#FF5555',
212 212
             1 => '#F7b7b7',
213
-            2 => '#5c8d20',# '#008800', #green'#55FF55',
213
+            2 => '#5c8d20', # '#008800', #green'#55FF55',
214 214
             3 => '#85eD82',
215 215
             4 => '#2E97E0', # blue
216 216
             5 => '#B9E3F9',
217
-            6 => '#e1711d',  # orange
217
+            6 => '#e1711d', # orange
218 218
             7 => '#ffc04c',
219 219
             8 => '#FDFF98', # yellow
220 220
             9 => '#5555FF',
221 221
             10 => '#55FFFF',
222
-            11 => '#0000C0',  #
223
-            12 => '#008800',  # green
222
+            11 => '#0000C0', #
223
+            12 => '#008800', # green
224 224
             13 => '#00C0C0',
225
-            14 => '#FFAFAF',  # rosé
226
-            15 => '#808080',  # gray
225
+            14 => '#FFAFAF', # rosé
226
+            15 => '#808080', # gray
227 227
             16 => '#00C000',
228 228
             17 => '#404040',
229
-            18 => '#C0C000',  # green
229
+            18 => '#C0C000', # green
230 230
             19 => '#C000C0',
231
-            100 => '#75A3D1',  # blue
232
-            101 => '#A679D2',  # purple
231
+            100 => '#75A3D1', # blue
232
+            101 => '#A679D2', # purple
233 233
             102 => '#660000',
234 234
             103 => '#000066',
235
-            104 => '#FAFFAF',  # caramel
235
+            104 => '#FAFFAF', # caramel
236 236
             105 => '#408345',
237 237
             106 => '#5c8d20',
238
-            107 => '#e1711d',  # red
239
-            108 => '#94ef2b',  # light green
240
-            109 => '#756a4a',  # brown
238
+            107 => '#e1711d', # red
239
+            108 => '#94ef2b', # light green
240
+            109 => '#756a4a', # brown
241 241
             110 => '#6f1dab',
242 242
             111 => '#301e30',
243 243
             112 => '#5c9d96',
244
-            113 => '#a8cd8c',  # earth green
245
-            114 => '#f2b3f1',  # light purple
244
+            113 => '#a8cd8c', # earth green
245
+            114 => '#f2b3f1', # light purple
246 246
             115 => '#9b5828',
247 247
             118 => '#99FFFF',
248 248
             119 => '#99BBFF',
@@ -263,8 +263,8 @@  discard block
 block discarded – undo
263 263
             446 => '#06DCFB',
264 264
             447 => '#892EE4',
265 265
             460 => '#99FF66',
266
-            461 => '#99CC66',  # green
267
-            470 => '#CCCC33',  # ocker
266
+            461 => '#99CC66', # green
267
+            470 => '#CCCC33', # ocker
268 268
             471 => '#CCFF33',
269 269
             480 => '#6699FF',
270 270
             481 => '#66FFFF',
@@ -279,18 +279,18 @@  discard block
 block discarded – undo
279 279
             1198 => '#FF34B3',
280 280
             1199 => '#8B1C62',
281 281
 
282
-            '#61a9f3',# blue
283
-            '#f381b9',# pink
282
+            '#61a9f3', # blue
283
+            '#f381b9', # pink
284 284
             '#61E3A9',
285 285
             '#D56DE2',
286 286
             '#85eD82',
287 287
             '#F7b7b7',
288 288
             '#CFDF49',
289 289
             '#88d8f2',
290
-            '#07AF7B',# green
290
+            '#07AF7B', # green
291 291
             '#B9E3F9',
292 292
             '#FFF3AD',
293
-            '#EF606A',# red
293
+            '#EF606A', # red
294 294
             '#EC8833',
295 295
             '#FFF100',
296 296
             '#87C9A5',
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
     public function getFilters()
405 405
     {
406 406
         return [
407
-            new \Twig_SimpleFilter('capitalize_first', [ $this, 'capitalizeFirst' ]),
407
+            new \Twig_SimpleFilter('capitalize_first', [$this, 'capitalizeFirst']),
408 408
         ];
409 409
     }
410 410
 
Please login to merge, or discard this patch.
src/AppBundle/Controller/EditCounterController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
         $username = $request->query->get('user');
28 28
 
29 29
         if (($project || $queryProject) && $username) {
30
-            $routeParams = [ 'project'=>($project ?: $queryProject), 'username' => $username ];
30
+            $routeParams = ['project'=>($project ?: $queryProject), 'username' => $username];
31 31
             return $this->redirectToRoute("EditCounterResult", $routeParams);
32 32
         } elseif (!$project && $queryProject) {
33
-            return $this->redirectToRoute("EditCounterProject", [ 'project'=>$queryProject ]);
33
+            return $this->redirectToRoute("EditCounterProject", ['project'=>$queryProject]);
34 34
         }
35 35
 
36 36
         // Otherwise fall through.
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
             'rev_small' => $revisionCounts['small'],
106 106
             'rev_large' => $revisionCounts['large'],
107 107
             'with_comments' => $revisionCounts['with_comments'],
108
-            'without_comments' => $revisionCounts['live'] - $revisionCounts['with_comments'],
108
+            'without_comments' => $revisionCounts['live']-$revisionCounts['with_comments'],
109 109
             'minor_edits' => $revisionCounts['minor_edits'],
110
-            'nonminor_edits' => $revisionCounts['live'] - $revisionCounts['minor_edits'],
110
+            'nonminor_edits' => $revisionCounts['live']-$revisionCounts['minor_edits'],
111 111
 
112 112
             // Page counts.
113 113
             'uniquePages' => $pageCounts['unique'],
Please login to merge, or discard this patch.
src/AppBundle/Twig/WikiExtension.php 2 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,6 @@  discard block
 block discarded – undo
72 72
 
73 73
     /**
74 74
      * Get a link to the given user's userpage, or to Special:Contribs if $username is an IP
75
-     * @param  string $username   Username
76 75
      * @param  string $projectUrl Project domain and protocol such as https://en.wikipedia.org
77 76
      * @param  string [$label]    The link text, defaults to $username
78 77
      * @return string Markup
@@ -176,7 +175,7 @@  discard block
 block discarded – undo
176 175
     /**
177 176
      * Get links to pageviews tools for the given page
178 177
      * @param  string $title      Title of page
179
-     * @param  string $projectUrl Project domain such as en.wikipedia.org
178
+     * @param  string $project Project domain such as en.wikipedia.org
180 179
      * @return string Markup
181 180
      */
182 181
     public function pageviewsLinks($title, $project)
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -14,23 +14,23 @@  discard block
 block discarded – undo
14 14
 
15 15
     public function intuitionMessage($message = "", $vars = [])
16 16
     {
17
-        return $this->getIntuition()->msg($message, [ "domain" => "xtools", "variables" => $vars ]);
17
+        return $this->getIntuition()->msg($message, ["domain" => "xtools", "variables" => $vars]);
18 18
     }
19 19
 
20 20
     /*********************************** FUNCTIONS ***********************************/
21 21
 
22 22
     public function getFunctions()
23 23
     {
24
-        $options = [ 'is_safe' => [ 'html']];
24
+        $options = ['is_safe' => ['html']];
25 25
         return [
26
-            new Twig_SimpleFunction('wiki_link', [ $this, 'wikiLink' ], $options),
27
-            new Twig_SimpleFunction('user_link', [ $this, 'userLink' ], $options),
28
-            new Twig_SimpleFunction('group_link', [ $this, 'groupLink' ], $options),
29
-            new Twig_SimpleFunction('wiki_history_link', [ $this, 'wikiHistoryLink' ], $options),
30
-            new Twig_SimpleFunction('wiki_log_link', [ $this, 'wikiLogLink' ], $options),
31
-            new Twig_SimpleFunction('pageviews_links', [ $this, 'pageviewsLinks' ], $options),
32
-            new Twig_SimpleFunction('diff_link', [ $this, 'diffLink' ], $options),
33
-            new Twig_SimpleFunction('perma_link', [ $this, 'permaLink' ], $options),
26
+            new Twig_SimpleFunction('wiki_link', [$this, 'wikiLink'], $options),
27
+            new Twig_SimpleFunction('user_link', [$this, 'userLink'], $options),
28
+            new Twig_SimpleFunction('group_link', [$this, 'groupLink'], $options),
29
+            new Twig_SimpleFunction('wiki_history_link', [$this, 'wikiHistoryLink'], $options),
30
+            new Twig_SimpleFunction('wiki_log_link', [$this, 'wikiLogLink'], $options),
31
+            new Twig_SimpleFunction('pageviews_links', [$this, 'pageviewsLinks'], $options),
32
+            new Twig_SimpleFunction('diff_link', [$this, 'diffLink'], $options),
33
+            new Twig_SimpleFunction('perma_link', [$this, 'permaLink'], $options),
34 34
         ];
35 35
     }
36 36
 
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
199 199
     public function getFilters()
200 200
     {
201 201
         return [
202
-            new \Twig_SimpleFilter('percent_format', [ $this, 'percentFormat' ]),
203
-            new \Twig_SimpleFilter('diff_format', [ $this, 'diffFormat' ], [ 'is_safe' => [ 'html' ] ]),
204
-            new \Twig_SimpleFilter('wikify_comment', [ $this, 'wikifyComment' ], [ 'is_safe' => [ 'html' ] ]),
202
+            new \Twig_SimpleFilter('percent_format', [$this, 'percentFormat']),
203
+            new \Twig_SimpleFilter('diff_format', [$this, 'diffFormat'], ['is_safe' => ['html']]),
204
+            new \Twig_SimpleFilter('wikify_comment', [$this, 'wikifyComment'], ['is_safe' => ['html']]),
205 205
         ];
206 206
     }
207 207
 
@@ -237,10 +237,10 @@  discard block
 block discarded – undo
237 237
         if (!$denominator) {
238 238
             $quotient = 0;
239 239
         } else {
240
-            $quotient = ( $numerator / $denominator ) * 100;
240
+            $quotient = ($numerator / $denominator) * 100;
241 241
         }
242 242
 
243
-        return round($quotient, $precision) . '%';
243
+        return round($quotient, $precision).'%';
244 244
     }
245 245
 
246 246
     /**
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         if ($isSection) {
259 259
             $sectionTitle = $sectionMatch[1][0];
260 260
             $sectionTitleLink = str_replace(' ', '_', $sectionTitle);
261
-            $sectionWikitext = "<a target='_blank' href='$projectUrl/wiki/$title#$sectionTitleLink'>&rarr;</a>" .
261
+            $sectionWikitext = "<a target='_blank' href='$projectUrl/wiki/$title#$sectionTitleLink'>&rarr;</a>".
262 262
                 "<em class='text-muted'>$sectionTitle:</em> ";
263 263
             $wikitext = str_replace($sectionMatch[0][0], $sectionWikitext, $wikitext);
264 264
         }
Please login to merge, or discard this patch.
src/AppBundle/Controller/AdminStatsController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
         // Iterate over query results, loading each user id into the array
182 182
         while ($row = $res->fetch()) {
183
-            $adminIdArr[] = $row["user_id"] ;
183
+            $adminIdArr[] = $row["user_id"];
184 184
         }
185 185
 
186 186
         // Set the query results to be useful in a sql statement.
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         }
234 234
 
235 235
         if ($adminCount > 0) {
236
-            $adminsWithoutActionPct = $adminsWithoutAction/$adminCount;
236
+            $adminsWithoutActionPct = $adminsWithoutAction / $adminCount;
237 237
         }
238 238
 
239 239
         // Combine the two arrays.  We can't use array_merge here because
Please login to merge, or discard this patch.