Test Failed
Pull Request — master (#143)
by Albert
04:44
created
src/Xtools/Page.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         $info = $this->getPageInfo();
82 82
         $title = isset($info['title']) ? $info['title'] : $this->unnormalizedPageName;
83 83
         $nsName = $this->getNamespaceName();
84
-        return str_replace($nsName . ':', '', $title);
84
+        return str_replace($nsName.':', '', $title);
85 85
     }
86 86
 
87 87
     /**
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
     {
218 218
         // If a user is given, we will not cache the result via instance variable.
219 219
         if ($user !== null) {
220
-            return (int) $this->getRepository()->getNumRevisions($this, $user);
220
+            return (int)$this->getRepository()->getNumRevisions($this, $user);
221 221
         }
222 222
 
223 223
         // Return cached value, if present.
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
             $this->numRevisions = count($this->revisions);
231 231
         } else {
232 232
             // Otherwise do a COUNT in the event fetching all revisions is not desired.
233
-            $this->numRevisions = (int) $this->getRepository()->getNumRevisions($this);
233
+            $this->numRevisions = (int)$this->getRepository()->getNumRevisions($this);
234 234
         }
235 235
 
236 236
         return $this->numRevisions;
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
     {
261 261
         $content = $this->getRepository()->getPagesWikitext(
262 262
             $this->getProject(),
263
-            [ $this->getTitle() ]
263
+            [$this->getTitle()]
264 264
         );
265 265
 
266 266
         return isset($content[$this->getTitle()])
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 
418 418
         $wikidataInfo = $this->getRepository()->getWikidataInfo($this);
419 419
 
420
-        $terms = array_map(function ($entry) {
420
+        $terms = array_map(function($entry) {
421 421
             return $entry['term'];
422 422
         }, $wikidataInfo);
423 423
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
                 'prio' => 2,
429 429
                 'name' => 'Wikidata',
430 430
                 'notice' => "Label for language <em>$lang</em> is missing", // FIXME: i18n
431
-                'explanation' => "See: <a target='_blank' " .
431
+                'explanation' => "See: <a target='_blank' ".
432 432
                     "href='//www.wikidata.org/wiki/Help:Label'>Help:Label</a>",
433 433
             ];
434 434
         }
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
                 'prio' => 3,
439 439
                 'name' => 'Wikidata',
440 440
                 'notice' => "Description for language <em>$lang</em> is missing", // FIXME: i18n
441
-                'explanation' => "See: <a target='_blank' " .
441
+                'explanation' => "See: <a target='_blank' ".
442 442
                     "href='//www.wikidata.org/wiki/Help:Description'>Help:Description</a>",
443 443
             ];
444 444
         }
@@ -517,8 +517,8 @@  discard block
 block discarded – undo
517 517
             return 0;
518 518
         }
519 519
 
520
-        return array_sum(array_map(function ($item) {
521
-            return (int) $item['views'];
520
+        return array_sum(array_map(function($item) {
521
+            return (int)$item['views'];
522 522
         }, $pageviews['items']));
523 523
     }
524 524
 
Please login to merge, or discard this patch.
src/AppBundle/Controller/EditCounterController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
         $isSubRequest = $this->container->get('request_stack')->getParentRequest() !== null;
137 137
 
138 138
         return $this->render('editCounter/result.html.twig', [
139
-            'xtTitle' => $this->user->getUsername() . ' - ' . $this->project->getTitle(),
139
+            'xtTitle' => $this->user->getUsername().' - '.$this->project->getTitle(),
140 140
             'xtPage' => 'ec',
141 141
             'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..'),
142 142
             'is_sub_request' => $isSubRequest,
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
@@ -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/Xtools/TopEdits.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
         $displayTitles = $this->getDisplayTitles($pages);
120 120
 
121 121
         foreach ($pages as $page) {
122
-            $nsId = (int) $page['page_namespace'];
123
-            $nsTitle = $nsId > 0 ? $this->project->getNamespaces()[$page['page_namespace']] . ':' : '';
124
-            $pageTitle = $nsTitle . $page['page_title'];
122
+            $nsId = (int)$page['page_namespace'];
123
+            $nsTitle = $nsId > 0 ? $this->project->getNamespaces()[$page['page_namespace']].':' : '';
124
+            $pageTitle = $nsTitle.$page['page_title'];
125 125
             $page['displaytitle'] = $displayTitles[$pageTitle];
126 126
 
127 127
             // $page['page_title'] is retained without the namespace
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
         $namespaces = $this->project->getNamespaces();
149 149
 
150 150
         // First extract page titles including namespace.
151
-        $pageTitles = array_map(function ($page) use ($namespaces) {
151
+        $pageTitles = array_map(function($page) use ($namespaces) {
152 152
             // If non-mainspace, prepend namespace to the titles.
153 153
             $ns = $page['page_namespace'];
154
-            $nsTitle = $ns > 0 ? $namespaces[$page['page_namespace']] . ':' : '';
155
-            return $nsTitle . $page['page_title'];
154
+            $nsTitle = $ns > 0 ? $namespaces[$page['page_namespace']].':' : '';
155
+            return $nsTitle.$page['page_title'];
156 156
         }, $topPages);
157 157
 
158 158
         return $this->getRepository()->getDisplayTitles($this->project, $pageTitles);
Please login to merge, or discard this patch.
src/Xtools/TopEditsRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
         $hasPageAssessments = $this->isLabs() && $project->hasPageAssessments() && $namespace === 0;
39 39
         $paSelect = $hasPageAssessments
40
-            ?  ", (
40
+            ? ", (
41 41
                     SELECT pa_class
42 42
                     FROM page_assessments
43 43
                     WHERE pa_page_id = page_id
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $hasPageAssessments = $this->isLabs() && $project->hasPageAssessments();
93 93
         $pageAssessmentsTable = $this->getTableName($project->getDatabaseName(), 'page_assessments');
94 94
         $paSelect = $hasPageAssessments
95
-            ?  ", (
95
+            ? ", (
96 96
                     SELECT pa_class
97 97
                     FROM $pageAssessmentsTable
98 98
                     WHERE pa_page_id = e.page_id
Please login to merge, or discard this patch.
src/AppBundle/Controller/TopEditsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@
 block discarded – undo
191 191
         // Send all to the template.
192 192
         return $this->render('topedits/result_article.html.twig', [
193 193
             'xtPage' => 'topedits',
194
-            'xtTitle' => $user->getUsername() . ' - ' . $page->getTitle(),
194
+            'xtTitle' => $user->getUsername().' - '.$page->getTitle(),
195 195
             'project' => $project,
196 196
             'user' => $user,
197 197
             'page' => $page,
Please login to merge, or discard this patch.
src/Xtools/AdminStatsRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
         $userGroupsTable = $project->getTableName('user_groups');
53 53
         $ufgTable = $project->getTableName('user_former_groups');
54 54
 
55
-        $adminGroups = join(array_map(function ($group) {
55
+        $adminGroups = join(array_map(function($group) {
56 56
             return "'$group'";
57 57
         }, $this->getAdminGroups($project)), ',');
58 58
 
Please login to merge, or discard this patch.
src/AppBundle/Controller/ArticleInfoController.php 1 patch
Spacing   +13 added lines, -13 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
-            $script .= $this->get('kernel')->getRootDir() .
91
-                "/Resources/node_modules/uglify-es/bin/uglifyjs $tmpFile --mangle " .
90
+            $script .= $this->get('kernel')->getRootDir().
91
+                "/Resources/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 \Symfony\Component\HttpFoundation\Response($rendered);
@@ -213,19 +213,19 @@  discard block
 block discarded – undo
213 213
         $info = $page->getBasicEditingInfo();
214 214
         $creationDateTime = DateTime::createFromFormat('YmdHis', $info['created_at']);
215 215
         $modifiedDateTime = DateTime::createFromFormat('YmdHis', $info['modified_at']);
216
-        $secsSinceLastEdit = (new DateTime)->getTimestamp() - $modifiedDateTime->getTimestamp();
216
+        $secsSinceLastEdit = (new DateTime)->getTimestamp()-$modifiedDateTime->getTimestamp();
217 217
 
218 218
         $data = [
219
-            'revisions' => (int) $info['num_edits'],
220
-            'editors' => (int) $info['num_editors'],
219
+            'revisions' => (int)$info['num_edits'],
220
+            'editors' => (int)$info['num_editors'],
221 221
             'author' => $info['author'],
222
-            'author_editcount' => (int) $info['author_editcount'],
222
+            'author_editcount' => (int)$info['author_editcount'],
223 223
             'created_at' => $creationDateTime->format('Y-m-d'),
224 224
             'created_rev_id' => $info['created_rev_id'],
225 225
             'modified_at' => $modifiedDateTime->format('Y-m-d H:i'),
226 226
             'secs_since_last_edit' => $secsSinceLastEdit,
227
-            'last_edit_id' => (int) $info['modified_rev_id'],
228
-            'watchers' => (int) $page->getWatchers(),
227
+            'last_edit_id' => (int)$info['modified_rev_id'],
228
+            'watchers' => (int)$page->getWatchers(),
229 229
             'pageviews' => $page->getLastPageviews($pageviewsOffset),
230 230
             'pageviews_offset' => $pageviewsOffset,
231 231
         ];
Please login to merge, or discard this patch.
src/Xtools/ArticleInfoRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         $userGroupsTable = $project->getTableName('user_groups');
23 23
         $userFromerGroupsTable = $project->getTableName('user_former_groups');
24 24
         $sql = "SELECT COUNT(rev_user_text) AS count, rev_user_text AS username, ug_group AS current
25
-                FROM " . $project->getTableName('revision') . "
25
+                FROM " . $project->getTableName('revision')."
26 26
                 LEFT JOIN $userGroupsTable ON rev_user = ug_user
27 27
                 LEFT JOIN $userFromerGroupsTable ON rev_user = ufg_user
28 28
                 WHERE rev_page = :pageId AND (ug_group = 'bot' OR ufg_group = 'bot')
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $loggingTable = $page->getProject()->getTableName('logging', 'logindex');
45 45
         $sql = "SELECT log_action, log_type, log_timestamp AS 'timestamp'
46 46
                 FROM $loggingTable
47
-                WHERE log_namespace = '" . $page->getNamespace() . "'
47
+                WHERE log_namespace = '".$page->getNamespace()."'
48 48
                 AND log_title = :title AND log_timestamp > 1
49 49
                 AND log_type IN ('delete', 'move', 'protect', 'stable')";
50 50
         $title = str_replace(' ', '_', $page->getTitle());
Please login to merge, or discard this patch.