Passed
Push — master ( a1a60b...e6cb36 )
by Matthew
01:24
created
src/AppBundle/Controller/RfXAnalysisController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -166,7 +166,7 @@
 block discarded – undo
166 166
         $neutral = $rfx->getSection('neutral');
167 167
         $dup = $rfx->getDuplicates();
168 168
 
169
-        $total = count($support) + count($oppose) + count($neutral);
169
+        $total = count($support)+count($oppose)+count($neutral);
170 170
 
171 171
         if ($total === 0) {
172 172
             $this->addFlash('notice', ['no-result', $pagename]);
Please login to merge, or discard this patch.
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/User.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             return $this->editCounts[$domain];
93 93
         }
94 94
 
95
-        $this->editCounts[$domain] = (int) $this->getRepository()->getEditCount(
95
+        $this->editCounts[$domain] = (int)$this->getRepository()->getEditCount(
96 96
             $project->getDatabaseName(),
97 97
             $this->getUsername()
98 98
         );
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
      */
159 159
     public function isAnon()
160 160
     {
161
-        return (bool) filter_var($this->username, FILTER_VALIDATE_IP);
161
+        return (bool)filter_var($this->username, FILTER_VALIDATE_IP);
162 162
     }
163 163
 
164 164
     /**
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
      */
221 221
     public function countEdits(Project $project, $namespace = 'all', $start = '', $end = '')
222 222
     {
223
-        return (int) $this->getRepository()->countEdits($project, $this, $namespace, $start, $end);
223
+        return (int)$this->getRepository()->countEdits($project, $this, $namespace, $start, $end);
224 224
     }
225 225
 
226 226
     /**
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
      */
234 234
     public function countAutomatedEdits(Project $project, $namespace = 'all', $start = '', $end = '')
235 235
     {
236
-        return (int) $this->getRepository()->countAutomatedEdits($project, $this, $namespace, $start, $end);
236
+        return (int)$this->getRepository()->countAutomatedEdits($project, $this, $namespace, $start, $end);
237 237
     }
238 238
 
239 239
     /**
@@ -265,12 +265,12 @@  discard block
 block discarded – undo
265 265
 
266 266
         $namespaces = $project->getNamespaces();
267 267
 
268
-        return array_map(function ($rev) use ($namespaces) {
268
+        return array_map(function($rev) use ($namespaces) {
269 269
             $pageTitle = $rev['page_title'];
270 270
             $fullPageTitle = '';
271 271
 
272 272
             if ($rev['page_namespace'] !== '0') {
273
-                $fullPageTitle = $namespaces[$rev['page_namespace']] . ":$pageTitle";
273
+                $fullPageTitle = $namespaces[$rev['page_namespace']].":$pageTitle";
274 274
             } else {
275 275
                 $fullPageTitle = $pageTitle;
276 276
             }
@@ -278,12 +278,12 @@  discard block
 block discarded – undo
278 278
             return [
279 279
                 'full_page_title' => $fullPageTitle,
280 280
                 'page_title' => $pageTitle,
281
-                'page_namespace' => (int) $rev['page_namespace'],
282
-                'rev_id' => (int) $rev['rev_id'],
281
+                'page_namespace' => (int)$rev['page_namespace'],
282
+                'rev_id' => (int)$rev['rev_id'],
283 283
                 'timestamp' => DateTime::createFromFormat('YmdHis', $rev['timestamp']),
284
-                'minor' => (bool) $rev['minor'],
285
-                'length' => (int) $rev['length'],
286
-                'length_change' => (int) $rev['length_change'],
284
+                'minor' => (bool)$rev['minor'],
285
+                'length' => (int)$rev['length'],
286
+                'length_change' => (int)$rev['length_change'],
287 287
                 'comment' => $rev['comment'],
288 288
             ];
289 289
         }, $revs);
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/AppBundle/Controller/MetaController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $timeline = [];
75 75
         $startObj = new DateTime($start);
76 76
         $endObj = new DateTime($end);
77
-        $numDays = (int) $endObj->diff($startObj)->format("%a");
77
+        $numDays = (int)$endObj->diff($startObj)->format("%a");
78 78
         $grandSum = 0;
79 79
 
80 80
         // Generate array of date labels
@@ -84,17 +84,17 @@  discard block
 block discarded – undo
84 84
 
85 85
         foreach ($data as $entry) {
86 86
             if (!isset($totals[$entry['tool']])) {
87
-                $totals[$entry['tool']] = (int) $entry['count'];
87
+                $totals[$entry['tool']] = (int)$entry['count'];
88 88
 
89 89
                 // Create arrays for each tool, filled with zeros for each date in the timeline
90 90
                 $timeline[$entry['tool']] = array_fill(0, $numDays, 0);
91 91
             } else {
92
-                $totals[$entry['tool']] += (int) $entry['count'];
92
+                $totals[$entry['tool']] += (int)$entry['count'];
93 93
             }
94 94
 
95 95
             $date = new DateTime($entry['date']);
96
-            $dateIndex = (int) $date->diff($startObj)->format("%a");
97
-            $timeline[$entry['tool']][$dateIndex] = (int) $entry['count'];
96
+            $dateIndex = (int)$date->diff($startObj)->format("%a");
97
+            $timeline[$entry['tool']][$dateIndex] = (int)$entry['count'];
98 98
 
99 99
             $grandSum += $entry['count'];
100 100
         }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         }
146 146
 
147 147
         $conn = $this->container->get('doctrine')->getManager('default')->getConnection();
148
-        $date =  date('Y-m-d');
148
+        $date = date('Y-m-d');
149 149
 
150 150
         // Increment count in timeline
151 151
         $existsSql = "SELECT 1 FROM usage_timeline
Please login to merge, or discard this patch.