Completed
Push — master ( 5c8e7a...62162d )
by MusikAnimal
22s
created
src/AppBundle/Controller/RfXVoteCalculatorController.php 3 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,6 @@
 block discarded – undo
3 3
 namespace AppBundle\Controller;
4 4
 
5 5
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6
-use Symfony\Component\CssSelector\Exception\InternalErrorException;
7
-use Symfony\Component\Debug\Exception\ContextErrorException;
8 6
 use Symfony\Component\HttpFoundation\Request;
9 7
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
10 8
 use Xtools\ProjectRepository;
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      * @Route("/rfxvote", name="rfxvote")
38 38
      * @Route("/rfxvote", name="RfXVoteCalculator")
39 39
      *
40
-     * @return Response
40
+     * @return \Symfony\Component\HttpFoundation\Response
41 41
      */
42 42
     public function indexAction()
43 43
     {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      *
87 87
      * @Route("/rfxvote/{project}/{username}", name="rfxvoteResult")
88 88
      *
89
-     * @return Response
89
+     * @return \Symfony\Component\HttpFoundation\Response
90 90
      */
91 91
     public function resultAction($project, $username)
92 92
     {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
         $username = $request->query->get('username');
49 49
 
50 50
         if ($projectQuery != '' && $username != '') {
51
-            $routeParams = [ 'project' => $projectQuery, 'username' => $username ];
51
+            $routeParams = ['project' => $projectQuery, 'username' => $username];
52 52
             return $this->redirectToRoute(
53 53
                 'rfxvoteResult',
54 54
                 $routeParams
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
             $titles = [];
168 168
 
169 169
             while ($row = $sth->fetch()) {
170
-                $titles[] = $namespaces[$row['page_namespace']] .
171
-                    ':' .$row['page_title'];
170
+                $titles[] = $namespaces[$row['page_namespace']].
171
+                    ':'.$row['page_title'];
172 172
             }
173 173
 
174 174
             // Chunking... it's possible to make a URI too long
Please login to merge, or discard this patch.
src/AppBundle/Controller/RfXAnalysisController.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
9 9
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
10 10
 use Symfony\Component\HttpFoundation\Request;
11
-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
12 11
 use Xtools\ProjectRepository;
13 12
 use Xtools\Page;
14 13
 use Xtools\PagesRepository;
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
      * @Route("/rfx/{project}",        name="rfxAnalysisProject")
45 45
      * @Route("/rfx/{project}/{type}", name="rfxAnalysisProjectType")
46 46
      *
47
-     * @return Response|RedirectResponse
47
+     * @return \Symfony\Component\HttpFoundation\Response
48 48
      */
49 49
     public function indexAction(Request $request, $project = null, $type = null)
50 50
     {
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      *
111 111
      * @Route("/rfx/{project}/{type}/{username}", name="rfxAnalysisResult")
112 112
      *
113
-     * @return Response|RedirectResponse
113
+     * @return \Symfony\Component\HttpFoundation\Response
114 114
      */
115 115
     public function resultAction($project, $type, $username)
116 116
     {
Please login to merge, or discard this 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   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         $info = $this->getPageInfo();
67 67
         $title = isset($info['title']) ? $info['title'] : $this->unnormalizedPageName;
68 68
         $nsName = $this->getNamespaceName();
69
-        return str_replace($nsName . ':', '', $title);
69
+        return str_replace($nsName.':', '', $title);
70 70
     }
71 71
 
72 72
     /**
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 
208 208
         // Otherwise do a COUNT in the event fetching
209 209
         // all revisions is not desired
210
-        return (int) $this->getRepository()->getNumRevisions($this, $user);
210
+        return (int)$this->getRepository()->getNumRevisions($this, $user);
211 211
     }
212 212
 
213 213
     /**
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
     {
235 235
         $content = $this->getRepository()->getPagesWikitext(
236 236
             $this->getProject(),
237
-            [ $this->getTitle() ]
237
+            [$this->getTitle()]
238 238
         );
239 239
 
240 240
         return isset($content[$this->getTitle()])
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
 
382 382
         $wikidataInfo = $this->getRepository()->getWikidataInfo($this);
383 383
 
384
-        $terms = array_map(function ($entry) {
384
+        $terms = array_map(function($entry) {
385 385
             return $entry['term'];
386 386
         }, $wikidataInfo);
387 387
 
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
                 'prio' => 2,
393 393
                 'name' => 'Wikidata',
394 394
                 'notice' => "Label for language <em>$lang</em> is missing", // FIXME: i18n
395
-                'explanation' => "See: <a target='_blank' " .
395
+                'explanation' => "See: <a target='_blank' ".
396 396
                     "href='//www.wikidata.org/wiki/Help:Label'>Help:Label</a>",
397 397
             ];
398 398
         }
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
                 'prio' => 3,
403 403
                 'name' => 'Wikidata',
404 404
                 'notice' => "Description for language <em>$lang</em> is missing", // FIXME: i18n
405
-                'explanation' => "See: <a target='_blank' " .
405
+                'explanation' => "See: <a target='_blank' ".
406 406
                     "href='//www.wikidata.org/wiki/Help:Description'>Help:Description</a>",
407 407
             ];
408 408
         }
@@ -473,8 +473,8 @@  discard block
 block discarded – undo
473 473
             return 0;
474 474
         }
475 475
 
476
-        return array_sum(array_map(function ($item) {
477
-            return (int) $item['views'];
476
+        return array_sum(array_map(function($item) {
477
+            return (int)$item['views'];
478 478
         }, $pageviews['items']));
479 479
     }
480 480
 
Please login to merge, or discard this patch.
src/Xtools/RFX.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
      * Returns matches.
36 36
      *
37 37
      * @param string $input   The line we're looking for
38
-     * @param array  $matches Pointer to an array where we stash results
38
+     * @param string[]  $matches Pointer to an array where we stash results
39 39
      *
40 40
      * @TODO: Make this cleaner
41 41
      *
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
             }
120 120
         }
121 121
 
122
-        $final = [];    // initialize the final array
122
+        $final = []; // initialize the final array
123 123
         $finalRaw = []; // Initialize the raw data array
124 124
 
125 125
         foreach ($this->data as $key => $value) {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
         $final = array_count_values($final); // find repetition and its count
134 134
 
135
-        $final = array_diff($final, [1]);    // remove single occurrences
135
+        $final = array_diff($final, [1]); // remove single occurrences
136 136
 
137 137
         $this->duplicates = array_keys($final);
138 138
     }
Please login to merge, or discard this patch.