Passed
Push — main ( 45df96...dd1e63 )
by MusikAnimal
04:03
created
src/AppBundle/Model/ArticleInfoApi.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types = 1);
2
+declare(strict_types=1);
3 3
 
4 4
 namespace AppBundle\Model;
5 5
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     public function getMaxRevisions(): int
93 93
     {
94 94
         if (!isset($this->maxRevisions)) {
95
-            $this->maxRevisions = (int) $this->container->getParameter('app.max_page_revisions');
95
+            $this->maxRevisions = (int)$this->container->getParameter('app.max_page_revisions');
96 96
         }
97 97
         return $this->maxRevisions;
98 98
     }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
         $refs = $crawler->filter('#mw-content-text .reference');
174 174
         $refContent = [];
175
-        $refs->each(function ($ref) use (&$refContent): void {
175
+        $refs->each(function($ref) use (&$refContent): void {
176 176
             $refContent[] = $ref->text();
177 177
         });
178 178
         $uniqueRefs = count(array_unique($refContent));
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         $totalChars = 0;
201 201
         $totalWords = 0;
202 202
         $paragraphs = $crawler->filter($selector);
203
-        $paragraphs->each(function ($node) use (&$totalChars, &$totalWords): void {
203
+        $paragraphs->each(function($node) use (&$totalChars, &$totalWords): void {
204 204
             /** @var Crawler $node */
205 205
             $text = preg_replace('/\[\d+]/', '', trim($node->text(null, true)));
206 206
             $totalChars += strlen($text);
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         $data = [
265 265
             'project' => $project->getDomain(),
266 266
             'page' => $page->getTitle(),
267
-            'watchers' => (int) $page->getWatchers(),
267
+            'watchers' => (int)$page->getWatchers(),
268 268
             'pageviews' => $page->getLastPageviews($pageviewsOffset),
269 269
             'pageviews_offset' => $pageviewsOffset,
270 270
         ];
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
         if (false !== $info) {
290 290
             $creationDateTime = DateTime::createFromFormat('YmdHis', $info['created_at']);
291 291
             $modifiedDateTime = DateTime::createFromFormat('YmdHis', $info['modified_at']);
292
-            $secsSinceLastEdit = (new DateTime)->getTimestamp() - $modifiedDateTime->getTimestamp();
292
+            $secsSinceLastEdit = (new DateTime)->getTimestamp()-$modifiedDateTime->getTimestamp();
293 293
 
294 294
             // Some wikis (such foundation.wikimedia.org) may be missing the creation date.
295 295
             $creationDateTime = false === $creationDateTime
@@ -301,16 +301,16 @@  discard block
 block discarded – undo
301 301
                 ->getAssessment($page);
302 302
 
303 303
             $data = array_merge($data, [
304
-                'revisions' => (int) $info['num_edits'],
305
-                'editors' => (int) $info['num_editors'],
306
-                'minor_edits' => (int) $info['minor_edits'],
304
+                'revisions' => (int)$info['num_edits'],
305
+                'editors' => (int)$info['num_editors'],
306
+                'minor_edits' => (int)$info['minor_edits'],
307 307
                 'author' => utf8_encode($info['author']), // Some really old author names have malformed characters.
308
-                'author_editcount' => null === $info['author_editcount'] ? null : (int) $info['author_editcount'],
308
+                'author_editcount' => null === $info['author_editcount'] ? null : (int)$info['author_editcount'],
309 309
                 'created_at' => $creationDateTime,
310 310
                 'created_rev_id' => $info['created_rev_id'],
311 311
                 'modified_at' => $modifiedDateTime->format('Y-m-d H:i'),
312 312
                 'secs_since_last_edit' => $secsSinceLastEdit,
313
-                'last_edit_id' => (int) $info['modified_rev_id'],
313
+                'last_edit_id' => (int)$info['modified_rev_id'],
314 314
                 'assessment' => $assessment,
315 315
             ]);
316 316
         }
@@ -462,8 +462,8 @@  discard block
 block discarded – undo
462 462
         }
463 463
 
464 464
         // Sort by edit count.
465
-        uasort($this->bots, function ($a, $b) {
466
-            return $b['count'] - $a['count'];
465
+        uasort($this->bots, function($a, $b) {
466
+            return $b['count']-$a['count'];
467 467
         });
468 468
 
469 469
         return $this->bots;
Please login to merge, or discard this patch.