@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | $username = $request->query->get('username', $request->query->get('user')); |
29 | 29 | |
30 | 30 | if ($projectQuery != "" && $username != "") { |
31 | - return $this->redirectToRoute("AdminScoreResult", [ 'project'=>$projectQuery, 'username' => $username ]); |
|
31 | + return $this->redirectToRoute("AdminScoreResult", ['project'=>$projectQuery, 'username' => $username]); |
|
32 | 32 | } elseif ($projectQuery != "") { |
33 | - return $this->redirectToRoute("AdminScoreProject", [ 'project'=>$projectQuery ]); |
|
33 | + return $this->redirectToRoute("AdminScoreProject", ['project'=>$projectQuery]); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | // Otherwise fall through. |
@@ -73,20 +73,20 @@ discard block |
||
73 | 73 | $archiveTable = $lh->getTable("archive", $dbName); |
74 | 74 | |
75 | 75 | // MULTIPLIERS (to review) |
76 | - $ACCT_AGE_MULT = 1.25; # 0 if = 365 jours |
|
77 | - $EDIT_COUNT_MULT = 1.25; # 0 if = 10 000 |
|
78 | - $USER_PAGE_MULT = 0.1; # 0 if = |
|
76 | + $ACCT_AGE_MULT = 1.25; # 0 if = 365 jours |
|
77 | + $EDIT_COUNT_MULT = 1.25; # 0 if = 10 000 |
|
78 | + $USER_PAGE_MULT = 0.1; # 0 if = |
|
79 | 79 | $PATROLS_MULT = 1; # 0 if = |
80 | - $BLOCKS_MULT = 1.4; # 0 if = 10 |
|
80 | + $BLOCKS_MULT = 1.4; # 0 if = 10 |
|
81 | 81 | $AFD_MULT = 1.15; |
82 | - $RECENT_ACTIVITY_MULT = 0.9; # 0 if = |
|
82 | + $RECENT_ACTIVITY_MULT = 0.9; # 0 if = |
|
83 | 83 | $AIV_MULT = 1.15; |
84 | - $EDIT_SUMMARIES_MULT = 0.8; # 0 if = |
|
85 | - $NAMESPACES_MULT = 1.0; # 0 if = |
|
84 | + $EDIT_SUMMARIES_MULT = 0.8; # 0 if = |
|
85 | + $NAMESPACES_MULT = 1.0; # 0 if = |
|
86 | 86 | $PAGES_CREATED_LIVE_MULT = 1.4; # 0 if = |
87 | 87 | $PAGES_CREATED_ARCHIVE_MULT = 1.4; # 0 if = |
88 | - $RPP_MULT = 1.15; # 0 if = |
|
89 | - $USERRIGHTS_MULT = 0.75; # 0 if = |
|
88 | + $RPP_MULT = 1.15; # 0 if = |
|
89 | + $USERRIGHTS_MULT = 0.75; # 0 if = |
|
90 | 90 | |
91 | 91 | // Grab the connection to the replica database (which is separate from the above) |
92 | 92 | $conn = $this->get('doctrine')->getManager("replicas")->getConnection(); |
@@ -162,15 +162,15 @@ discard block |
||
162 | 162 | $now = new DateTime(); |
163 | 163 | $date = new DateTime($value); |
164 | 164 | $diff = $date->diff($now); |
165 | - $formula = 365*$diff->format("%y")+30*$diff->format("%m")+$diff->format("%d"); |
|
165 | + $formula = 365 * $diff->format("%y")+30 * $diff->format("%m")+$diff->format("%d"); |
|
166 | 166 | $value = $formula-365; |
167 | 167 | } |
168 | 168 | |
169 | 169 | if ($key == "id") { |
170 | 170 | $id = $value; |
171 | 171 | } else { |
172 | - $multiplierKey = strtoupper($row["source"] . "_MULT"); |
|
173 | - $multiplier = ( isset($$multiplierKey) ? $$multiplierKey : 1 ); |
|
172 | + $multiplierKey = strtoupper($row["source"]."_MULT"); |
|
173 | + $multiplier = (isset($$multiplierKey) ? $$multiplierKey : 1); |
|
174 | 174 | $score = max(min($value * $multiplier, 100), -100); |
175 | 175 | $master[$key]["mult"] = $multiplier; |
176 | 176 | $master[$key]["value"] = $value; |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | if ($id == 0) { |
183 | - $this->addFlash("notice", [ "no-result", $username ]); |
|
184 | - return $this->redirectToRoute("AdminScore", [ "project"=>$project ]); |
|
183 | + $this->addFlash("notice", ["no-result", $username]); |
|
184 | + return $this->redirectToRoute("AdminScore", ["project"=>$project]); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | return $this->render('adminscore/result.html.twig', [ |
@@ -32,10 +32,10 @@ discard block |
||
32 | 32 | $username = $request->query->get('username', $request->query->get('user')); |
33 | 33 | |
34 | 34 | if ($projectQuery != "" && $username != "") { |
35 | - $routeParams = [ 'project'=>$projectQuery, 'username' => $username ]; |
|
35 | + $routeParams = ['project'=>$projectQuery, 'username' => $username]; |
|
36 | 36 | return $this->redirectToRoute("SimpleEditCounterResult", $routeParams); |
37 | 37 | } elseif ($projectQuery != "") { |
38 | - return $this->redirectToRoute("SimpleEditCounterProject", [ 'project'=>$projectQuery ]); |
|
38 | + return $this->redirectToRoute("SimpleEditCounterProject", ['project'=>$projectQuery]); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | // Otherwise fall through. |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | $resultQuery->execute(); |
93 | 93 | |
94 | 94 | if ($resultQuery->errorCode() > 0) { |
95 | - $this->addFlash("notice", [ "no-result", $username ]); |
|
96 | - return $this->redirectToRoute("SimpleEditCounterProject", [ "project"=>$project ]); |
|
95 | + $this->addFlash("notice", ["no-result", $username]); |
|
96 | + return $this->redirectToRoute("SimpleEditCounterProject", ["project"=>$project]); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | // Fetch the result data |
@@ -117,16 +117,16 @@ discard block |
||
117 | 117 | $rev = $row["value"]; |
118 | 118 | } |
119 | 119 | if ($row["source"] == "groups") { |
120 | - $groups .= $row["value"]. ", "; |
|
120 | + $groups .= $row["value"].", "; |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
124 | 124 | // Unknown user - If the user is created the $results variable will have 3 entries. |
125 | 125 | // This is a workaround to detect non-existent IPs. |
126 | 126 | if (count($results) < 3 && $arch == 0 && $rev == 0) { |
127 | - $this->addFlash('notice', [ "no-result", $username ]); |
|
127 | + $this->addFlash('notice', ["no-result", $username]); |
|
128 | 128 | |
129 | - return $this->redirectToRoute("SimpleEditCounterProject", [ "project"=>$project ]); |
|
129 | + return $this->redirectToRoute("SimpleEditCounterProject", ["project"=>$project]); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | // Remove the last comma and space |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | 'project_url' => $url, |
157 | 157 | 'id' => $id, |
158 | 158 | 'arch' => $arch, |
159 | - 'rev' => $rev + $arch, |
|
159 | + 'rev' => $rev+$arch, |
|
160 | 160 | 'live' => $rev, |
161 | 161 | 'groups' => $groups, |
162 | 162 | 'globalGroups' => $globalGroups, |
@@ -76,10 +76,10 @@ |
||
76 | 76 | $username = $request->query->get('username', $request->query->get('user')); |
77 | 77 | |
78 | 78 | if (($project || $queryProject) && $username) { |
79 | - $routeParams = [ 'project'=>($project ?: $queryProject), 'username' => $username ]; |
|
79 | + $routeParams = ['project'=>($project ?: $queryProject), 'username' => $username]; |
|
80 | 80 | return $this->redirectToRoute("EditCounterResult", $routeParams); |
81 | 81 | } elseif (!$project && $queryProject) { |
82 | - return $this->redirectToRoute("EditCounterProject", [ 'project'=>$queryProject ]); |
|
82 | + return $this->redirectToRoute("EditCounterProject", ['project'=>$queryProject]); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | $project = ProjectRepository::getProject($queryProject, $this->container); |