Passed
Pull Request — master (#143)
by Albert
04:49
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/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.
src/Xtools/ProjectRepository.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
                     || $projMetadata['url'] == "https://$project"
150 150
                     || $projMetadata['url'] == "https://$project.org"
151 151
                     || $projMetadata['url'] == "https://www.$project") {
152
-                    $this->log->debug(__METHOD__ . " Using cached data for $project");
152
+                    $this->log->debug(__METHOD__." Using cached data for $project");
153 153
                     return $projMetadata;
154 154
                 }
155 155
             }
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
         $optedIn = $this->container->getParameter('opted_in');
293 293
         // In case there's just one given.
294 294
         if (!is_array($optedIn)) {
295
-            $optedIn = [ $optedIn ];
295
+            $optedIn = [$optedIn];
296 296
         }
297 297
         return $optedIn;
298 298
     }
Please login to merge, or discard this patch.
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -339,9 +339,9 @@
 block discarded – undo
339 339
         $conn = $this->getProjectsConnection();
340 340
         $pageTable = $this->getTableName($project->getDatabaseName(), 'page');
341 341
         $query = "SELECT page_id "
342
-             . " FROM $pageTable "
343
-             . " WHERE page_namespace = :ns AND page_title = :title AND page_len > 0 "
344
-             . " LIMIT 1";
342
+                . " FROM $pageTable "
343
+                . " WHERE page_namespace = :ns AND page_title = :title AND page_len > 0 "
344
+                . " LIMIT 1";
345 345
         $params = [
346 346
             'ns' => $namespaceId,
347 347
             'title' => str_replace(' ', '_', $pageTitle),
Please login to merge, or discard this patch.