@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the ArticleInfo class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Model; |
| 9 | 9 | |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | public function getMaxRevisions(): int |
| 244 | 244 | { |
| 245 | 245 | if (!isset($this->maxRevisions)) { |
| 246 | - $this->maxRevisions = (int) $this->container->getParameter('app.max_page_revisions'); |
|
| 246 | + $this->maxRevisions = (int)$this->container->getParameter('app.max_page_revisions'); |
|
| 247 | 247 | } |
| 248 | 248 | return $this->maxRevisions; |
| 249 | 249 | } |
@@ -1012,7 +1012,7 @@ discard block |
||
| 1012 | 1012 | $this->yearMonthCounts[$editYear]['all']++; |
| 1013 | 1013 | $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']++; |
| 1014 | 1014 | // This will ultimately be the size of the page by the end of the year |
| 1015 | - $this->yearMonthCounts[$editYear]['size'] = (int) $edit->getLength(); |
|
| 1015 | + $this->yearMonthCounts[$editYear]['size'] = (int)$edit->getLength(); |
|
| 1016 | 1016 | |
| 1017 | 1017 | // Keep track of which month had the most edits |
| 1018 | 1018 | $editsThisMonth = $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']; |
@@ -1167,8 +1167,8 @@ discard block |
||
| 1167 | 1167 | } |
| 1168 | 1168 | |
| 1169 | 1169 | // Sort by edit count. |
| 1170 | - uasort($bots, function ($a, $b) { |
|
| 1171 | - return $b['count'] - $a['count']; |
|
| 1170 | + uasort($bots, function($a, $b) { |
|
| 1171 | + return $b['count']-$a['count']; |
|
| 1172 | 1172 | }); |
| 1173 | 1173 | |
| 1174 | 1174 | $this->bots = $bots; |
@@ -1277,7 +1277,7 @@ discard block |
||
| 1277 | 1277 | |
| 1278 | 1278 | if ($info['all'] > 1) { |
| 1279 | 1279 | // Number of seconds/days between first and last edit. |
| 1280 | - $secs = $info['last']->getTimestamp() - $info['first']->getTimestamp(); |
|
| 1280 | + $secs = $info['last']->getTimestamp()-$info['first']->getTimestamp(); |
|
| 1281 | 1281 | $days = $secs / (60 * 60 * 24); |
| 1282 | 1282 | |
| 1283 | 1283 | // Average time between edits (in days). |
@@ -1286,7 +1286,7 @@ discard block |
||
| 1286 | 1286 | } |
| 1287 | 1287 | |
| 1288 | 1288 | // Loop through again and add percentages. |
| 1289 | - $this->topTenEditorsByEdits = array_map(function ($editor) use ($topTenCount) { |
|
| 1289 | + $this->topTenEditorsByEdits = array_map(function($editor) use ($topTenCount) { |
|
| 1290 | 1290 | $editor['percentage'] = 100 * ($editor['value'] / $topTenCount); |
| 1291 | 1291 | return $editor; |
| 1292 | 1292 | }, $topTenEditorsByEdits); |
@@ -1304,7 +1304,7 @@ discard block |
||
| 1304 | 1304 | { |
| 1305 | 1305 | // First sort editors array by the amount of text they added. |
| 1306 | 1306 | $topTenEditorsByAdded = $this->editors; |
| 1307 | - uasort($topTenEditorsByAdded, function ($a, $b) { |
|
| 1307 | + uasort($topTenEditorsByAdded, function($a, $b) { |
|
| 1308 | 1308 | if ($a['added'] === $b['added']) { |
| 1309 | 1309 | return 0; |
| 1310 | 1310 | } |
@@ -1320,7 +1320,7 @@ discard block |
||
| 1320 | 1320 | // }, $topTenEditorsByAdded)); |
| 1321 | 1321 | |
| 1322 | 1322 | // Then build a new array of top 10 editors by added text in the data structure needed for the chart. |
| 1323 | - return array_map(function ($editor) { |
|
| 1323 | + return array_map(function($editor) { |
|
| 1324 | 1324 | $added = $this->editors[$editor]['added']; |
| 1325 | 1325 | return [ |
| 1326 | 1326 | 'label' => $editor, |
@@ -1470,7 +1470,7 @@ discard block |
||
| 1470 | 1470 | |
| 1471 | 1471 | $refs = $crawler->filter('#mw-content-text .reference'); |
| 1472 | 1472 | $refContent = []; |
| 1473 | - $refs->each(function ($ref) use (&$refContent): void { |
|
| 1473 | + $refs->each(function($ref) use (&$refContent): void { |
|
| 1474 | 1474 | $refContent[] = $ref->text(); |
| 1475 | 1475 | }); |
| 1476 | 1476 | $uniqueRefs = count(array_unique($refContent)); |
@@ -1497,7 +1497,7 @@ discard block |
||
| 1497 | 1497 | $totalChars = 0; |
| 1498 | 1498 | $totalWords = 0; |
| 1499 | 1499 | $paragraphs = $crawler->filter($selector); |
| 1500 | - $paragraphs->each(function ($node) use (&$totalChars, &$totalWords): void { |
|
| 1500 | + $paragraphs->each(function($node) use (&$totalChars, &$totalWords): void { |
|
| 1501 | 1501 | $text = preg_replace('/\[\d+\]/', '', trim($node->text())); |
| 1502 | 1502 | $totalChars += strlen($text); |
| 1503 | 1503 | $totalWords += count(explode(' ', $text)); |
@@ -213,9 +213,9 @@ |
||
| 213 | 213 | // Record character count and percentage for the remaining editors. |
| 214 | 214 | if ($percentageSum < 100) { |
| 215 | 215 | $this->data['others'] = [ |
| 216 | - 'count' => $totalCount - $countSum, |
|
| 217 | - 'percentage' => round(100 - $percentageSum, 1), |
|
| 218 | - 'numEditors' => count($counts) - $numEditors, |
|
| 216 | + 'count' => $totalCount-$countSum, |
|
| 217 | + 'percentage' => round(100-$percentageSum, 1), |
|
| 218 | + 'numEditors' => count($counts)-$numEditors, |
|
| 219 | 219 | ]; |
| 220 | 220 | } |
| 221 | 221 | } |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the ArticleInfoRepository class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Repository; |
| 9 | 9 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | $sql = "SELECT log_action, log_type, log_timestamp AS 'timestamp' |
| 78 | 78 | FROM $loggingTable |
| 79 | - WHERE log_namespace = '" . $page->getNamespace() . "' |
|
| 79 | + WHERE log_namespace = '".$page->getNamespace()."' |
|
| 80 | 80 | AND log_title = :title AND log_timestamp > 1 $datesConditions |
| 81 | 81 | AND log_type IN ('delete', 'move', 'protect', 'stable')"; |
| 82 | 82 | $title = str_replace(' ', '_', $page->getTitle()); |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace AppBundle\Repository; |
| 5 | 5 | |