Test Failed
Pull Request — master (#225)
by MusikAnimal
06:05
created
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/RfXAnalysisController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
 
113 113
         // Construct the page name
114 114
         if (!isset($this->getParameter('rfx')[$domain]['pages'][$type])) {
115
-            $pageTitle= '';
115
+            $pageTitle = '';
116 116
         } else {
117
-            $pageTitle= $this->getParameter('rfx')[$domain]['pages'][$type];
117
+            $pageTitle = $this->getParameter('rfx')[$domain]['pages'][$type];
118 118
         }
119 119
 
120
-        $pageTitle.= '/'.$this->user->getUsername();
120
+        $pageTitle .= '/'.$this->user->getUsername();
121 121
         $page = new Page($this->project, $pageTitle);
122 122
         $pageRepo = new PageRepository();
123 123
         $pageRepo->setContainer($this->container);
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         $neutral = $rfx->getSection('neutral');
146 146
         $dup = $rfx->getDuplicates();
147 147
 
148
-        $total = count($support) + count($oppose) + count($neutral);
148
+        $total = count($support)+count($oppose)+count($neutral);
149 149
 
150 150
         if (0 === $total) {
151 151
             $this->addFlash('notice', ['no-result', $pageTitle]);
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.
src/AppBundle/Controller/AutomatedEditsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
             'total_editcount' => $this->autoEdits->getEditCount(),
243 243
             'automated_editcount' => $this->autoEdits->getAutomatedCount(),
244 244
         ];
245
-        $ret['nonautomated_editcount'] = $ret['total_editcount'] - $ret['automated_editcount'];
245
+        $ret['nonautomated_editcount'] = $ret['total_editcount']-$ret['automated_editcount'];
246 246
 
247 247
         if ('' != $tools) {
248 248
             $tools = $this->autoEdits->getToolCounts();
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 
275 275
         $this->setupAutoEdits();
276 276
 
277
-        $ret = array_map(function ($rev) {
277
+        $ret = array_map(function($rev) {
278 278
             return array_merge([
279 279
                 'full_page_title' => $this->getPageFromNsAndTitle($rev['page_namespace'], $rev['page_title'], true),
280 280
             ], $rev);
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
             $ret['tool'] = $this->autoEdits->getTool();
312 312
         }
313 313
 
314
-        $ret['automated_edits'] = array_map(function ($rev) {
314
+        $ret['automated_edits'] = array_map(function($rev) {
315 315
             return array_merge([
316 316
                 'full_page_title' => $this->getPageFromNsAndTitle($rev['page_namespace'], $rev['page_title'], true),
317 317
             ], $rev);
Please login to merge, or discard this patch.
src/AppBundle/Controller/CategoryEditsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@
 block discarded – undo
128 128
         // 'Category:', which sometimes is used cross-wiki (because it still works).
129 129
         $normalized = false;
130 130
         $nsName = $this->project->getNamespaces()[14].':';
131
-        $this->categories = array_map(function ($category) use ($nsName, &$normalized) {
131
+        $this->categories = array_map(function($category) use ($nsName, &$normalized) {
132 132
             if (0 === strpos($category, $nsName) || 0 === strpos($category, 'Category:')) {
133 133
                 $normalized = true;
134 134
             }
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
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     public function loginAction(): RedirectResponse
105 105
     {
106 106
         try {
107
-            [ $next, $token ] = $this->getOauthClient()->initiate();
107
+            [$next, $token] = $this->getOauthClient()->initiate();
108 108
         } catch (Exception $oauthException) {
109 109
             throw $oauthException;
110 110
             // @TODO Make this work.
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                     . '?title=Special:OAuth';
175 175
         $conf = new ClientConfig($endpoint);
176 176
         $consumerKey = $this->getParameter('oauth_key');
177
-        $consumerSecret =  $this->getParameter('oauth_secret');
177
+        $consumerSecret = $this->getParameter('oauth_secret');
178 178
         $conf->setConsumer(new Consumer($consumerKey, $consumerSecret));
179 179
         $this->oauthClient = new Client($conf);
180 180
         // Callback URL is hardcoded in the consumer registration.
Please login to merge, or discard this patch.
src/AppBundle/Exception/XtoolsHttpException.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
 /**
5 5
  * This file contains only the XtoolsHttpException class.
Please login to merge, or discard this patch.