Passed
Push — master ( 03db17...72b2a9 )
by MusikAnimal
08:00
created
src/AppBundle/Controller/MetaController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         $timeline = [];
96 96
         $startObj = new DateTime($start);
97 97
         $endObj = new DateTime($end);
98
-        $numDays = (int) $endObj->diff($startObj)->format("%a");
98
+        $numDays = (int)$endObj->diff($startObj)->format("%a");
99 99
         $grandSum = 0;
100 100
 
101 101
         // Generate array of date labels
@@ -105,17 +105,17 @@  discard block
 block discarded – undo
105 105
 
106 106
         foreach ($data as $entry) {
107 107
             if (!isset($totals[$entry['tool']])) {
108
-                $totals[$entry['tool']] = (int) $entry['count'];
108
+                $totals[$entry['tool']] = (int)$entry['count'];
109 109
 
110 110
                 // Create arrays for each tool, filled with zeros for each date in the timeline
111 111
                 $timeline[$entry['tool']] = array_fill(0, $numDays, 0);
112 112
             } else {
113
-                $totals[$entry['tool']] += (int) $entry['count'];
113
+                $totals[$entry['tool']] += (int)$entry['count'];
114 114
             }
115 115
 
116 116
             $date = new DateTime($entry['date']);
117
-            $dateIndex = (int) $date->diff($startObj)->format("%a");
118
-            $timeline[$entry['tool']][$dateIndex] = (int) $entry['count'];
117
+            $dateIndex = (int)$date->diff($startObj)->format("%a");
118
+            $timeline[$entry['tool']][$dateIndex] = (int)$entry['count'];
119 119
 
120 120
             $grandSum += $entry['count'];
121 121
         }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         $timeline = [];
153 153
         $startObj = new DateTime($start);
154 154
         $endObj = new DateTime($end);
155
-        $numDays = (int) $endObj->diff($startObj)->format("%a");
155
+        $numDays = (int)$endObj->diff($startObj)->format("%a");
156 156
         $grandSum = 0;
157 157
 
158 158
         // Generate array of date labels
@@ -162,17 +162,17 @@  discard block
 block discarded – undo
162 162
 
163 163
         foreach ($data as $entry) {
164 164
             if (!isset($totals[$entry['endpoint']])) {
165
-                $totals[$entry['endpoint']] = (int) $entry['count'];
165
+                $totals[$entry['endpoint']] = (int)$entry['count'];
166 166
 
167 167
                 // Create arrays for each endpoint, filled with zeros for each date in the timeline
168 168
                 $timeline[$entry['endpoint']] = array_fill(0, $numDays, 0);
169 169
             } else {
170
-                $totals[$entry['endpoint']] += (int) $entry['count'];
170
+                $totals[$entry['endpoint']] += (int)$entry['count'];
171 171
             }
172 172
 
173 173
             $date = new DateTime($entry['date']);
174
-            $dateIndex = (int) $date->diff($startObj)->format("%a");
175
-            $timeline[$entry['endpoint']][$dateIndex] = (int) $entry['count'];
174
+            $dateIndex = (int)$date->diff($startObj)->format("%a");
175
+            $timeline[$entry['endpoint']][$dateIndex] = (int)$entry['count'];
176 176
 
177 177
             $grandSum += $entry['count'];
178 178
         }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         }
220 220
 
221 221
         $conn = $this->container->get('doctrine')->getManager('default')->getConnection();
222
-        $date =  date('Y-m-d');
222
+        $date = date('Y-m-d');
223 223
 
224 224
         // Increment count in timeline
225 225
         $existsSql = "SELECT 1 FROM usage_timeline
Please login to merge, or discard this patch.
src/AppBundle/Controller/RfXVoteCalculatorController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -136,8 +136,8 @@
 block discarded – undo
136 136
             $titles = [];
137 137
 
138 138
             while ($row = $sth->fetch()) {
139
-                $titles[] = $namespaces[$row['page_namespace']] .
140
-                    ':' .$row['page_title'];
139
+                $titles[] = $namespaces[$row['page_namespace']].
140
+                    ':'.$row['page_title'];
141 141
             }
142 142
 
143 143
             // Chunking... it's possible to make a URI too long
Please login to merge, or discard this patch.
src/AppBundle/Controller/PagesController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -347,7 +347,7 @@
 block discarded – undo
347 347
         ];
348 348
 
349 349
         if ($pages->getNumResults() === $pages->resultsPerPage()) {
350
-            $ret['continue'] = $this->offset + 1;
350
+            $ret['continue'] = $this->offset+1;
351 351
         }
352 352
 
353 353
         return $this->getFormattedApiResponse($ret);
Please login to merge, or discard this patch.
src/AppBundle/Controller/QuoteController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@
 block discarded – undo
197 197
 
198 198
         // Number the quotes, since they somehow have significance.
199 199
         foreach ($quotes as $index => $quote) {
200
-            $numberedQuotes[(string)($index + 1)] = $quote;
200
+            $numberedQuotes[(string)($index+1)] = $quote;
201 201
         }
202 202
 
203 203
         return new JsonResponse($numberedQuotes, Response::HTTP_OK);
Please login to merge, or discard this patch.
src/AppBundle/Controller/AdminStatsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
         $this->setUpAdminStats();
150 150
 
151 151
         // Maximum 31 days.
152
-        $days = min((int) $days, 31);
152
+        $days = min((int)$days, 31);
153 153
         $start = date('Y-m-d', strtotime("-$days days"));
154 154
         $end = date('Y-m-d');
155 155
 
Please login to merge, or discard this patch.
public/app.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 use Symfony\Component\HttpFoundation\Request;
5 5
 
Please login to merge, or discard this patch.
public/app_dev.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 use Symfony\Component\Debug\Debug;
5 5
 use Symfony\Component\HttpFoundation\Request;
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 // Feel free to remove this, extend it, or make something more sophisticated.
14 14
 if (isset($_SERVER['HTTP_CLIENT_IP'])
15 15
     || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
16
-    || !( in_array(@$_SERVER['REMOTE_ADDR'], [ '127.0.0.1', 'fe80::1', '::1' ]) || 'cli-server' === php_sapi_name() )
16
+    || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || 'cli-server' === php_sapi_name())
17 17
 ) {
18 18
     header('HTTP/1.0 403 Forbidden');
19 19
     exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
Please login to merge, or discard this patch.
src/AppBundle/Controller/ArticleInfoController.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
             $rendered = str_replace('"', '\"', trim($rendered));
86 86
 
87 87
             // Uglify temporary file.
88
-            $tmpFile = sys_get_temp_dir() . '/xtools_articleinfo_gadget.js';
88
+            $tmpFile = sys_get_temp_dir().'/xtools_articleinfo_gadget.js';
89 89
             $script = "echo \"$rendered\" | tee $tmpFile >/dev/null && ";
90 90
             $script .= $this->get('kernel')->getProjectDir().
91
-                "/node_modules/uglify-es/bin/uglifyjs $tmpFile --mangle " .
91
+                "/node_modules/uglify-es/bin/uglifyjs $tmpFile --mangle ".
92 92
                 "&& rm $tmpFile >/dev/null";
93 93
             $process = new Process($script);
94 94
             $process->run();
@@ -107,10 +107,10 @@  discard block
 block discarded – undo
107 107
             $rendered = str_replace('\"', '"', trim($rendered));
108 108
 
109 109
             // Add comment after uglifying since it removes comments.
110
-            $rendered = "/**\n * This code was automatically generated and should not " .
111
-                "be manually edited.\n * For updates, please copy and paste from " .
112
-                $this->generateUrl('ArticleInfoGadget', ['uglify' => 1], UrlGeneratorInterface::ABSOLUTE_URL) .
113
-                "\n * Released under GPL v3 license.\n */\n" . $rendered;
110
+            $rendered = "/**\n * This code was automatically generated and should not ".
111
+                "be manually edited.\n * For updates, please copy and paste from ".
112
+                $this->generateUrl('ArticleInfoGadget', ['uglify' => 1], UrlGeneratorInterface::ABSOLUTE_URL).
113
+                "\n * Released under GPL v3 license.\n */\n".$rendered;
114 114
         }
115 115
 
116 116
         $response = new Response($rendered);
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
         $data = [
264 264
             'project' => $project->getDomain(),
265 265
             'page' => $page->getTitle(),
266
-            'watchers' => (int) $page->getWatchers(),
266
+            'watchers' => (int)$page->getWatchers(),
267 267
             'pageviews' => $page->getLastPageviews($pageviewsOffset),
268 268
             'pageviews_offset' => $pageviewsOffset,
269 269
         ];
@@ -286,22 +286,22 @@  discard block
 block discarded – undo
286 286
         if (false != $info) {
287 287
             $creationDateTime = DateTime::createFromFormat('YmdHis', $info['created_at']);
288 288
             $modifiedDateTime = DateTime::createFromFormat('YmdHis', $info['modified_at']);
289
-            $secsSinceLastEdit = (new DateTime)->getTimestamp() - $modifiedDateTime->getTimestamp();
289
+            $secsSinceLastEdit = (new DateTime)->getTimestamp()-$modifiedDateTime->getTimestamp();
290 290
 
291 291
             $assessment = $page->getProject()
292 292
                 ->getPageAssessments()
293 293
                 ->getAssessment($page);
294 294
 
295 295
             $data = array_merge($data, [
296
-                'revisions' => (int) $info['num_edits'],
297
-                'editors' => (int) $info['num_editors'],
296
+                'revisions' => (int)$info['num_edits'],
297
+                'editors' => (int)$info['num_editors'],
298 298
                 'author' => $info['author'],
299
-                'author_editcount' => (int) $info['author_editcount'],
299
+                'author_editcount' => (int)$info['author_editcount'],
300 300
                 'created_at' => $creationDateTime->format('Y-m-d'),
301 301
                 'created_rev_id' => $info['created_rev_id'],
302 302
                 'modified_at' => $modifiedDateTime->format('Y-m-d H:i'),
303 303
                 'secs_since_last_edit' => $secsSinceLastEdit,
304
-                'last_edit_id' => (int) $info['modified_rev_id'],
304
+                'last_edit_id' => (int)$info['modified_rev_id'],
305 305
                 'assessment' => $assessment,
306 306
             ]);
307 307
         }
Please login to merge, or discard this patch.
src/AppBundle/Controller/XtoolsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
         $params = $this->convertLegacyParams($params);
505 505
 
506 506
         // Remove blank values.
507
-        return array_filter($params, function ($param) {
507
+        return array_filter($params, function($param) {
508 508
             // 'namespace' or 'username' could be '0'.
509 509
             return null !== $param && '' !== $param;
510 510
         });
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
         $response->setStatusCode(Response::HTTP_OK);
656 656
 
657 657
         $elapsedTime = round(
658
-            microtime(true) - $this->request->server->get('REQUEST_TIME_FLOAT'),
658
+            microtime(true)-$this->request->server->get('REQUEST_TIME_FLOAT'),
659 659
             3
660 660
         );
661 661
 
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
         $conn = $this->container->get('doctrine')
683 683
             ->getManager('default')
684 684
             ->getConnection();
685
-        $date =  date('Y-m-d');
685
+        $date = date('Y-m-d');
686 686
 
687 687
         // Increment count in timeline
688 688
         $existsSql = "SELECT 1 FROM usage_api_timeline
Please login to merge, or discard this patch.