Passed
Pull Request — main (#463)
by MusikAnimal
06:12 queued 03:18
created
src/Repository/ArticleInfoRepository.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace App\Repository;
6 6
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
         $sql = "SELECT log_action, log_type, log_timestamp AS 'timestamp'
175 175
                 FROM $loggingTable
176
-                WHERE log_namespace = '" . $page->getNamespace() . "'
176
+                WHERE log_namespace = '".$page->getNamespace()."'
177 177
                 AND log_title = :title AND log_timestamp > 1 $datesConditions
178 178
                 AND log_type IN ('delete', 'move', 'protect', 'stable')";
179 179
         $title = str_replace(' ', '_', $page->getTitle());
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
         $time2 = time();
359 359
 
360 360
         // If it took over 5 seconds, cache the result for 20 minutes.
361
-        if ($time2 - $time1 > 5) {
361
+        if ($time2-$time1 > 5) {
362 362
             $this->setCache($cacheKey, $result, 'PT20M');
363 363
         }
364 364
 
@@ -429,8 +429,8 @@  discard block
 block discarded – undo
429 429
         }
430 430
 
431 431
         // Sort the array by count
432
-        uasort($results, function ($a, $b) {
433
-            return $b['count'] - $a['count'];
432
+        uasort($results, function($a, $b) {
433
+            return $b['count']-$a['count'];
434 434
         });
435 435
 
436 436
         return $this->setCache($cacheKey, $results);
Please login to merge, or discard this patch.
src/Model/ArticleInfoApi.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types = 1);
3
+declare(strict_types=1);
4 4
 
5 5
 namespace App\Model;
6 6
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         [$bytes, $chars, $words] = $this->countCharsAndWords($crawler);
179 179
 
180 180
         $refContent = [];
181
-        $refs->each(function ($ref) use (&$refContent): void {
181
+        $refs->each(function($ref) use (&$refContent): void {
182 182
             $refContent[] = $ref->text();
183 183
         });
184 184
         $uniqueRefs = count(array_unique($refContent));
@@ -213,13 +213,13 @@  discard block
 block discarded – undo
213 213
             '[typeof~="mw:Extension/templatestyles"]',
214 214
             '[typeof~="mw:Extension/math"]',
215 215
             '[typeof~="mw:Extension/ref"]',
216
-        ]))->each(function (Crawler $subCrawler) {
216
+        ]))->each(function(Crawler $subCrawler) {
217 217
             foreach ($subCrawler as $subNode) {
218 218
                 $subNode->parentNode->removeChild($subNode);
219 219
             }
220 220
         });
221 221
 
222
-        $paragraphs->each(function ($node) use (&$totalBytes, &$totalChars, &$totalWords): void {
222
+        $paragraphs->each(function($node) use (&$totalBytes, &$totalChars, &$totalWords): void {
223 223
             /** @var Crawler $node */
224 224
             $text = $node->text();
225 225
             $totalBytes += strlen($text);
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         $data = [
282 282
             'project' => $project->getDomain(),
283 283
             'page' => $page->getTitle(),
284
-            'watchers' => (int) $page->getWatchers(),
284
+            'watchers' => (int)$page->getWatchers(),
285 285
             'pageviews' => $page->getLatestPageviews(),
286 286
             'pageviews_offset' => self::PAGEVIEWS_OFFSET,
287 287
         ];
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
         if ($info) {
305 305
             $creationDateTime = DateTime::createFromFormat('YmdHis', $info['created_at']);
306 306
             $modifiedDateTime = DateTime::createFromFormat('YmdHis', $info['modified_at']);
307
-            $secsSinceLastEdit = (new DateTime)->getTimestamp() - $modifiedDateTime->getTimestamp();
307
+            $secsSinceLastEdit = (new DateTime)->getTimestamp()-$modifiedDateTime->getTimestamp();
308 308
 
309 309
             // Some wikis (such foundation.wikimedia.org) may be missing the creation date.
310 310
             $creationDateTime = false === $creationDateTime
@@ -316,17 +316,17 @@  discard block
 block discarded – undo
316 316
                 ->getAssessment($page);
317 317
 
318 318
             $data = array_merge($data, [
319
-                'revisions' => (int) $info['num_edits'],
320
-                'editors' => (int) $info['num_editors'],
321
-                'ip_editors' => (int) $info['num_ip_editors'],
322
-                'minor_edits' => (int) $info['minor_edits'],
319
+                'revisions' => (int)$info['num_edits'],
320
+                'editors' => (int)$info['num_editors'],
321
+                'ip_editors' => (int)$info['num_ip_editors'],
322
+                'minor_edits' => (int)$info['minor_edits'],
323 323
                 'author' => $info['author'],
324
-                'author_editcount' => null === $info['author_editcount'] ? null : (int) $info['author_editcount'],
324
+                'author_editcount' => null === $info['author_editcount'] ? null : (int)$info['author_editcount'],
325 325
                 'created_at' => $creationDateTime,
326 326
                 'created_rev_id' => $info['created_rev_id'],
327 327
                 'modified_at' => $modifiedDateTime->format('Y-m-d H:i'),
328 328
                 'secs_since_last_edit' => $secsSinceLastEdit,
329
-                'last_edit_id' => (int) $info['modified_rev_id'],
329
+                'last_edit_id' => (int)$info['modified_rev_id'],
330 330
                 'assessment' => $assessment,
331 331
             ]);
332 332
         }
@@ -476,8 +476,8 @@  discard block
 block discarded – undo
476 476
         }
477 477
 
478 478
         // Sort by edit count.
479
-        uasort($this->bots, function ($a, $b) {
480
-            return $b['count'] - $a['count'];
479
+        uasort($this->bots, function($a, $b) {
480
+            return $b['count']-$a['count'];
481 481
         });
482 482
 
483 483
         return $this->bots;
Please login to merge, or discard this patch.