Completed
Pull Request — master (#67)
by Matthew
04:49 queued 01:41
created
src/AppBundle/Controller/RfXAnalysisController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,6 @@
 block discarded – undo
14 14
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
15 15
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
16 16
 use Symfony\Component\HttpFoundation\Request;
17
-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
18 17
 use Xtools\ProjectRepository;
19 18
 use Xtools\RFA;
20 19
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         $neutral = $rfa->getSection("neutral");
171 171
         $dup = $rfa->getDuplicates();
172 172
 
173
-        if ((sizeof($support) + sizeof($oppose) + sizeof($neutral)) == 0) {
173
+        if ((sizeof($support)+sizeof($oppose)+sizeof($neutral)) == 0) {
174 174
             $this->addFlash("notice", ["no-result", $pagename]);
175 175
             return $this->redirectToRoute(
176 176
                 "rfxAnalysisProject",
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         $end = $rfa->getEndDate();
184 184
 
185 185
         $percent = (sizeof($support) /
186
-            (sizeof($support) + sizeof($oppose) + sizeof($neutral)));
186
+            (sizeof($support)+sizeof($oppose)+sizeof($neutral)));
187 187
 
188 188
         $percent = $percent * 100;
189 189
 
Please login to merge, or discard this patch.
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.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         $username = $request->query->get('username');
42 42
 
43 43
         if ($projectQuery != "" && $username != "") {
44
-            $routeParams = [ 'project'=>$projectQuery, 'username' => $username ];
44
+            $routeParams = ['project'=>$projectQuery, 'username' => $username];
45 45
             return $this->redirectToRoute(
46 46
                 "rfapResult",
47 47
                 $routeParams
@@ -135,8 +135,8 @@  discard block
 block discarded – undo
135 135
             $titles = [];
136 136
 
137 137
             while ($row = $sth->fetch()) {
138
-                $titles[] = $namespaces[$row["page_namespace"]] .
139
-                    ":" .$row["page_title"];
138
+                $titles[] = $namespaces[$row["page_namespace"]].
139
+                    ":".$row["page_title"];
140 140
             }
141 141
 
142 142
             // Chunking... it's possible to make a URI too long
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
      *
93 93
      * @Route("/rfap/{project}/{username}", name="rfapResult")
94 94
      *
95
-     * @return Response
95
+     * @return \Symfony\Component\HttpFoundation\Response
96 96
      */
97 97
     public function resultAction($project, $username)
98 98
     {
Please login to merge, or discard this patch.
src/Xtools/RFA.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.
src/AppBundle/Helper/ApiHelper.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     public function groups($project, $username)
61 61
     {
62 62
         $this->setUp($project);
63
-        $params = [ "list"=>"users", "ususers"=>$username, "usprop"=>"groups" ];
63
+        $params = ["list"=>"users", "ususers"=>$username, "usprop"=>"groups"];
64 64
         $query = new SimpleRequest('query', $params);
65 65
         $result = [];
66 66
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     public function globalGroups($project, $username)
89 89
     {
90 90
         $this->setUp($project);
91
-        $params = [ "meta"=>"globaluserinfo", "guiuser"=>$username, "guiprop"=>"groups" ];
91
+        $params = ["meta"=>"globaluserinfo", "guiuser"=>$username, "guiprop"=>"groups"];
92 92
         $query = new SimpleRequest('query', $params);
93 93
         $result = [];
94 94
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                 $groups[] = "B";
139 139
             }
140 140
             if (in_array("steward", $admin["groups"])) {
141
-                $groups[] = "S" ;
141
+                $groups[] = "S";
142 142
             }
143 143
             if (in_array("checkuser", $admin["groups"])) {
144 144
                 $groups[] = "CU";
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             if (in_array("bot", $admin["groups"])) {
150 150
                 $groups[] = "Bot";
151 151
             }
152
-            $result[ $admin["name"] ] = [
152
+            $result[$admin["name"]] = [
153 153
                 "groups" => implode('/', $groups)
154 154
             ];
155 155
         }
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             $normalized = [];
183 183
             if (isset($result['query']['normalized'])) {
184 184
                 array_map(
185
-                    function ($e) use (&$normalized) {
185
+                    function($e) use (&$normalized) {
186 186
                         $normalized[$e['to']] = $e['from'];
187 187
                     },
188 188
                     $result['query']['normalized']
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
         $query = FluentRequest::factory()->setAction('query')->setParams($requestData);
268 268
         $innerPromise = $this->api->getRequestAsync($query);
269 269
 
270
-        $innerPromise->then(function ($result) use (&$data) {
270
+        $innerPromise->then(function($result) use (&$data) {
271 271
             // some failures come back as 200s, so we still resolve and let the outer function handle it
272 272
             if (isset($result['error']) || !isset($result['query'])) {
273 273
                 return $data['promise']->resolve($data);
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
 
366 366
         $titleText = join("|", $titles);
367 367
 
368
-        $params= [
368
+        $params = [
369 369
             "titles" => $titleText,
370 370
             "prop" => "revisions",
371 371
             "rvprop" =>"content"
Please login to merge, or discard this patch.