Completed
Pull Request — master (#29)
by Matthew
02:47
created
src/AppBundle/Controller/AdminScoreController.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -27,9 +27,9 @@  discard block
 block discarded – undo
27 27
         $username = $request->query->get('username');
28 28
 
29 29
         if ($projectQuery != "" && $username != "") {
30
-            return $this->redirectToRoute("AdminScoreResult", [ 'project'=>$projectQuery, 'username' => $username ]);
30
+            return $this->redirectToRoute("AdminScoreResult", ['project'=>$projectQuery, 'username' => $username]);
31 31
         } elseif ($projectQuery != "") {
32
-            return $this->redirectToRoute("AdminScoreProject", [ 'project'=>$projectQuery ]);
32
+            return $this->redirectToRoute("AdminScoreProject", ['project'=>$projectQuery]);
33 33
         }
34 34
 
35 35
         // Otherwise fall through.
@@ -67,20 +67,20 @@  discard block
 block discarded – undo
67 67
         $archiveTable = $lh->getTable("archive", $dbName);
68 68
 
69 69
         // MULTIPLIERS (to review)
70
-        $ACCT_AGE_MULT = 1.25;   # 0 if = 365 jours
71
-        $COUNT_MULT = 1.25;     # 0 if = 10 000
72
-        $USER_PAGE_MULT = 0.1;     # 0 if =
70
+        $ACCT_AGE_MULT = 1.25; # 0 if = 365 jours
71
+        $COUNT_MULT = 1.25; # 0 if = 10 000
72
+        $USER_PAGE_MULT = 0.1; # 0 if =
73 73
         $PATROL_MULT = 1; # 0 if =
74
-        $BLOCK_MULT = 1.4;     # 0 if = 10
74
+        $BLOCK_MULT = 1.4; # 0 if = 10
75 75
         $AFD_MULT = 1.15;
76
-        $RECENT_ACTIVITY_MULT = 0.9;     # 0 if =
76
+        $RECENT_ACTIVITY_MULT = 0.9; # 0 if =
77 77
         $AIV_MULT = 1.15;
78
-        $EDITS_SUMMARY_MULT = 0.8;   # 0 if =
79
-        $NAMESPACE_MULT = 1.0;     # 0 if =
78
+        $EDITS_SUMMARY_MULT = 0.8; # 0 if =
79
+        $NAMESPACE_MULT = 1.0; # 0 if =
80 80
         $PAGES_CREATED_MULT = 1.4; # 0 if =
81 81
         $PAGES_CREATED_ARCHIVE_MULT = 1.4; # 0 if =
82
-        $RPP_MULT = 1.15;     # 0 if =
83
-        $USERRIGHTS_MULT = 0.75;   # 0 if =
82
+        $RPP_MULT = 1.15; # 0 if =
83
+        $USERRIGHTS_MULT = 0.75; # 0 if =
84 84
 
85 85
         // Grab the connection to the replica database (which is separate from the above)
86 86
         $conn = $this->get('doctrine')->getManager("replicas")->getConnection();
@@ -158,15 +158,15 @@  discard block
 block discarded – undo
158 158
                 $now = new DateTime();
159 159
                 $date = new DateTime($value);
160 160
                 $diff = $date->diff($now);
161
-                $formula = 365*$diff->format("%y")+30*$diff->format("%m")+$diff->format("%d");
161
+                $formula = 365 * $diff->format("%y")+30 * $diff->format("%m")+$diff->format("%d");
162 162
                 $value = $formula-365;
163 163
             }
164 164
 
165 165
             if ($key == "id") {
166 166
                 $id = $value;
167 167
             } else {
168
-                $multiplierKey = strtoupper($row["source"] . "_MULT");
169
-                $multiplier = ( isset($$multiplierKey) ? $$multiplierKey : 1 );
168
+                $multiplierKey = strtoupper($row["source"]."_MULT");
169
+                $multiplier = (isset($$multiplierKey) ? $$multiplierKey : 1);
170 170
                 $score = max(min($value * $multiplier, 100), -100);
171 171
                 $master[$key]["mult"] = $multiplier;
172 172
                 $master[$key]["value"] = $value;
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
         }
177 177
 
178 178
         if ($id == 0) {
179
-            $this->addFlash("notice", [ "noresult", $username ]);
180
-            return $this->redirectToRoute("AdminScore", [ "project"=>$project ]);
179
+            $this->addFlash("notice", ["noresult", $username]);
180
+            return $this->redirectToRoute("AdminScore", ["project"=>$project]);
181 181
         }
182 182
 
183 183
         return $this->render('adminscore/result.html.twig', [
Please login to merge, or discard this patch.