Completed
Pull Request — master (#100)
by MusikAnimal
02:25
created
src/Xtools/User.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             return $this->editCounts[$domain];
93 93
         }
94 94
 
95
-        $this->editCounts[$domain] = (int) $this->getRepository()->getEditCount(
95
+        $this->editCounts[$domain] = (int)$this->getRepository()->getEditCount(
96 96
             $project->getDatabaseName(),
97 97
             $this->getUsername()
98 98
         );
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
      */
233 233
     public function countAutomatedEdits(Project $project, $namespace = 'all', $start = '', $end = '')
234 234
     {
235
-        return (int) $this->getRepository()->countAutomatedEdits($project, $this, $namespace, $start, $end);
235
+        return (int)$this->getRepository()->countAutomatedEdits($project, $this, $namespace, $start, $end);
236 236
     }
237 237
 
238 238
     /**
@@ -264,12 +264,12 @@  discard block
 block discarded – undo
264 264
 
265 265
         $namespaces = $project->getNamespaces();
266 266
 
267
-        return array_map(function ($rev) use ($namespaces) {
267
+        return array_map(function($rev) use ($namespaces) {
268 268
             $pageTitle = $rev['page_title'];
269 269
             $fullPageTitle = '';
270 270
 
271 271
             if ($rev['page_namespace'] !== '0') {
272
-                $fullPageTitle = $namespaces[$rev['page_namespace']] . ":$pageTitle";
272
+                $fullPageTitle = $namespaces[$rev['page_namespace']].":$pageTitle";
273 273
             } else {
274 274
                 $fullPageTitle = $pageTitle;
275 275
             }
@@ -277,12 +277,12 @@  discard block
 block discarded – undo
277 277
             return [
278 278
                 'full_page_title' => $fullPageTitle,
279 279
                 'page_title' => $pageTitle,
280
-                'page_namespace' => (int) $rev['page_namespace'],
281
-                'rev_id' => (int) $rev['rev_id'],
280
+                'page_namespace' => (int)$rev['page_namespace'],
281
+                'rev_id' => (int)$rev['rev_id'],
282 282
                 'timestamp' => DateTime::createFromFormat('YmdHis', $rev['timestamp']),
283
-                'minor' => (bool) $rev['minor'],
284
-                'length' => (int) $rev['length'],
285
-                'length_change' => (int) $rev['length_change'],
283
+                'minor' => (bool)$rev['minor'],
284
+                'length' => (int)$rev['length'],
285
+                'length_change' => (int)$rev['length_change'],
286 286
                 'comment' => $rev['comment'],
287 287
             ];
288 288
         }, $revs);
Please login to merge, or discard this patch.
src/AppBundle/Controller/ApiController.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -169,8 +169,8 @@  discard block
 block discarded – undo
169 169
             if ($request->query->get('format') !== 'html') {
170 170
                 return new View(
171 171
                     [
172
-                        'error' => 'Unable to show any data. User has made over ' .
173
-                            $user->maxEdits() . ' edits.',
172
+                        'error' => 'Unable to show any data. User has made over '.
173
+                            $user->maxEdits().' edits.',
174 174
                     ],
175 175
                     Response::HTTP_FORBIDDEN
176 176
                 );
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
         if ($request->query->get('format') === 'html') {
188 188
             if ($data) {
189
-                $edits = array_map(function ($attrs) use ($project, $username) {
189
+                $edits = array_map(function($attrs) use ($project, $username) {
190 190
                     $page = $project->getRepository()
191 191
                         ->getPage($project, $attrs['full_page_title']);
192 192
                     $pageTitles[] = $attrs['full_page_title'];
@@ -264,19 +264,19 @@  discard block
 block discarded – undo
264 264
         $info = $page->getBasicEditingInfo();
265 265
         $creationDateTime = DateTime::createFromFormat('YmdHis', $info['created_at']);
266 266
         $modifiedDateTime = DateTime::createFromFormat('YmdHis', $info['modified_at']);
267
-        $secsSinceLastEdit = (new DateTime)->getTimestamp() - $modifiedDateTime->getTimestamp();
267
+        $secsSinceLastEdit = (new DateTime)->getTimestamp()-$modifiedDateTime->getTimestamp();
268 268
 
269 269
         $data = [
270
-            'revisions' => (int) $info['num_edits'],
271
-            'editors' => (int) $info['num_editors'],
270
+            'revisions' => (int)$info['num_edits'],
271
+            'editors' => (int)$info['num_editors'],
272 272
             'author' => $info['author'],
273
-            'author_editcount' => (int) $info['author_editcount'],
273
+            'author_editcount' => (int)$info['author_editcount'],
274 274
             'created_at' => $creationDateTime->format('Y-m-d'),
275 275
             'created_rev_id' => $info['created_rev_id'],
276 276
             'modified_at' => $modifiedDateTime->format('Y-m-d H:i'),
277 277
             'secs_since_last_edit' => $secsSinceLastEdit,
278
-            'last_edit_id' => (int) $info['modified_rev_id'],
279
-            'watchers' => (int) $page->getWatchers(),
278
+            'last_edit_id' => (int)$info['modified_rev_id'],
279
+            'watchers' => (int)$page->getWatchers(),
280 280
             'pageviews' => $page->getLastPageviews($pageviewsOffset),
281 281
             'pageviews_offset' => $pageviewsOffset,
282 282
         ];
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
         }
335 335
 
336 336
         $conn = $this->getDoctrine()->getManager('default')->getConnection();
337
-        $date =  date('Y-m-d');
337
+        $date = date('Y-m-d');
338 338
 
339 339
         // Increment count in timeline
340 340
         $existsSql = "SELECT 1 FROM usage_timeline
Please login to merge, or discard this patch.