Completed
Push — master ( c6c8e9...9ee82d )
by Matthew
02:56
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('user');
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_userindex", $dbName);
68 68
 
69 69
         // MULTIPLIERS (to review)
70
-        $ACCT_AGE_MULT = 1.25;   # 0 if = 365 jours
71
-        $EDIT_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
+        $EDIT_COUNT_MULT = 1.25; # 0 if = 10 000
72
+        $USER_PAGE_MULT = 0.1; # 0 if =
73 73
         $PATROLS_MULT = 1; # 0 if =
74
-        $BLOCKS_MULT = 1.4;     # 0 if = 10
74
+        $BLOCKS_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
-        $EDIT_SUMMARIES_MULT = 0.8;   # 0 if =
79
-        $NAMESPACES_MULT = 1.0;     # 0 if =
78
+        $EDIT_SUMMARIES_MULT = 0.8; # 0 if =
79
+        $NAMESPACES_MULT = 1.0; # 0 if =
80 80
         $PAGES_CREATED_LIVE_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();
@@ -156,15 +156,15 @@  discard block
 block discarded – undo
156 156
                 $now = new DateTime();
157 157
                 $date = new DateTime($value);
158 158
                 $diff = $date->diff($now);
159
-                $formula = 365*$diff->format("%y")+30*$diff->format("%m")+$diff->format("%d");
159
+                $formula = 365 * $diff->format("%y")+30 * $diff->format("%m")+$diff->format("%d");
160 160
                 $value = $formula-365;
161 161
             }
162 162
 
163 163
             if ($key == "id") {
164 164
                 $id = $value;
165 165
             } else {
166
-                $multiplierKey = strtoupper($row["source"] . "_MULT");
167
-                $multiplier = ( isset($$multiplierKey) ? $$multiplierKey : 1 );
166
+                $multiplierKey = strtoupper($row["source"]."_MULT");
167
+                $multiplier = (isset($$multiplierKey) ? $$multiplierKey : 1);
168 168
                 $score = max(min($value * $multiplier, 100), -100);
169 169
                 $master[$key]["mult"] = $multiplier;
170 170
                 $master[$key]["value"] = $value;
@@ -174,8 +174,8 @@  discard block
 block discarded – undo
174 174
         }
175 175
 
176 176
         if ($id == 0) {
177
-            $this->addFlash("notice", [ "noresult", $username ]);
178
-            return $this->redirectToRoute("AdminScore", [ "project"=>$project ]);
177
+            $this->addFlash("notice", ["noresult", $username]);
178
+            return $this->redirectToRoute("AdminScore", ["project"=>$project]);
179 179
         }
180 180
 
181 181
         // replace this example code with whatever you need
Please login to merge, or discard this patch.