Completed
Pull Request — master (#113)
by MusikAnimal
02:24
created
src/AppBundle/Controller/AdminStatsController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,6 @@
 block discarded – undo
16 16
 use Symfony\Component\HttpFoundation\JsonResponse;
17 17
 use Xtools\AdminStats;
18 18
 use Xtools\AdminStatsRepository;
19
-use Xtools\ProjectRepository;
20 19
 
21 20
 /**
22 21
  * Class AdminStatsController
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@
 block discarded – undo
171 171
     public function adminStatsApiAction($project, $days = 30)
172 172
     {
173 173
         // Maximum 30 days.
174
-        $days = min((int) $days, 30);
174
+        $days = min((int)$days, 30);
175 175
         $start = date('Y-m-d', strtotime("-$days days"));
176 176
         $end = date('Y-m-d');
177 177
 
Please login to merge, or discard this patch.
src/Xtools/AdminStats.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -5,9 +5,6 @@
 block discarded – undo
5 5
 
6 6
 namespace Xtools;
7 7
 
8
-use Symfony\Component\DependencyInjection\Container;
9
-use DateTime;
10
-
11 8
 /**
12 9
  * AdminStats returns information about users with administrative
13 10
  * rights on a given wiki.
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
      */
118 118
     public function numDays()
119 119
     {
120
-        return ($this->end - $this->start) / 60 / 60 / 24;
120
+        return ($this->end-$this->start) / 60 / 60 / 24;
121 121
     }
122 122
 
123 123
     /**
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
      */
281 281
     public function getNumAdminsWithActions()
282 282
     {
283
-        return $this->numAdmins() - $this->adminsWithoutActions;
283
+        return $this->numAdmins()-$this->adminsWithoutActions;
284 284
     }
285 285
 
286 286
     /**
Please login to merge, or discard this patch.
src/Xtools/TopEdits.php 1 patch
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -5,9 +5,6 @@
 block discarded – undo
5 5
 
6 6
 namespace Xtools;
7 7
 
8
-use Symfony\Component\DependencyInjection\Container;
9
-use DateTime;
10
-
11 8
 /**
12 9
  * TopEdits returns the top-edited pages by a user.
13 10
  */
Please login to merge, or discard this patch.
src/AppBundle/Helper/ApiHelper.php 1 patch
Spacing   +4 added lines, -4 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
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             $normalized = [];
131 131
             if (isset($result['query']['normalized'])) {
132 132
                 array_map(
133
-                    function ($e) use (&$normalized) {
133
+                    function($e) use (&$normalized) {
134 134
                         $normalized[$e['to']] = $e['from'];
135 135
                     },
136 136
                     $result['query']['normalized']
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
         $query = FluentRequest::factory()->setAction('query')->setParams($requestData);
216 216
         $innerPromise = $this->api->getRequestAsync($query);
217 217
 
218
-        $innerPromise->then(function ($result) use (&$data) {
218
+        $innerPromise->then(function($result) use (&$data) {
219 219
             // some failures come back as 200s, so we still resolve and let the outer function handle it
220 220
             if (isset($result['error']) || !isset($result['query'])) {
221 221
                 return $data['promise']->resolve($data);
Please login to merge, or discard this patch.
src/Xtools/AdminStatsRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
         $userGroupsTable = $project->getTableName('user_groups');
53 53
         $ufgTable = $project->getTableName('user_former_groups');
54 54
 
55
-        $adminGroups = join(array_map(function ($group) {
55
+        $adminGroups = join(array_map(function($group) {
56 56
             return "'$group'";
57 57
         }, $this->getAdminGroups($project)), ',');
58 58
 
Please login to merge, or discard this patch.