@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace App\Twig; |
| 5 | 5 | |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the AppExtension class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace App\Twig; |
| 9 | 9 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | public function requestTime(): float |
| 122 | 122 | { |
| 123 | 123 | if (!isset($this->requestTime)) { |
| 124 | - $this->requestTime = microtime(true) - $this->getRequest()->server->get('REQUEST_TIME_FLOAT'); |
|
| 124 | + $this->requestTime = microtime(true)-$this->getRequest()->server->get('REQUEST_TIME_FLOAT'); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | return $this->requestTime; |
@@ -549,7 +549,7 @@ discard block |
||
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | $sizeMessage = $this->numberFormat( |
| 552 | - pow(1024, $base - floor($base)), |
|
| 552 | + pow(1024, $base-floor($base)), |
|
| 553 | 553 | $precision |
| 554 | 554 | ); |
| 555 | 555 | |
@@ -706,15 +706,15 @@ discard block |
||
| 706 | 706 | |
| 707 | 707 | if ($seconds >= 86400) { |
| 708 | 708 | // Over a day |
| 709 | - $val = (int) floor($seconds / 86400); |
|
| 709 | + $val = (int)floor($seconds / 86400); |
|
| 710 | 710 | $key = 'days'; |
| 711 | 711 | } elseif ($seconds >= 3600) { |
| 712 | 712 | // Over an hour, less than a day |
| 713 | - $val = (int) floor($seconds / 3600); |
|
| 713 | + $val = (int)floor($seconds / 3600); |
|
| 714 | 714 | $key = 'hours'; |
| 715 | 715 | } elseif ($seconds >= 60) { |
| 716 | 716 | // Over a minute, less than an hour |
| 717 | - $val = (int) floor($seconds / 60); |
|
| 717 | + $val = (int)floor($seconds / 60); |
|
| 718 | 718 | $key = 'minutes'; |
| 719 | 719 | } |
| 720 | 720 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace App; |
| 6 | 6 | |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | $actions = is_array($actionsQuery) ? $actionsQuery : explode('|', $actionsQuery); |
| 119 | 119 | |
| 120 | 120 | // Filter out any invalid section IDs. |
| 121 | - $actions = array_filter($actions, function ($action) use ($group) { |
|
| 121 | + $actions = array_filter($actions, function($action) use ($group) { |
|
| 122 | 122 | return in_array($action, $this->getActionNames($group)); |
| 123 | 123 | }); |
| 124 | 124 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $timeline = []; |
| 102 | 102 | $startObj = new DateTime($start); |
| 103 | 103 | $endObj = new DateTime($end); |
| 104 | - $numDays = (int) $endObj->diff($startObj)->format("%a"); |
|
| 104 | + $numDays = (int)$endObj->diff($startObj)->format("%a"); |
|
| 105 | 105 | $grandSum = 0; |
| 106 | 106 | |
| 107 | 107 | // Generate array of date labels |
@@ -111,17 +111,17 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | foreach ($data as $entry) { |
| 113 | 113 | if (!isset($totals[$entry['tool']])) { |
| 114 | - $totals[$entry['tool']] = (int) $entry['count']; |
|
| 114 | + $totals[$entry['tool']] = (int)$entry['count']; |
|
| 115 | 115 | |
| 116 | 116 | // Create arrays for each tool, filled with zeros for each date in the timeline |
| 117 | 117 | $timeline[$entry['tool']] = array_fill(0, $numDays, 0); |
| 118 | 118 | } else { |
| 119 | - $totals[$entry['tool']] += (int) $entry['count']; |
|
| 119 | + $totals[$entry['tool']] += (int)$entry['count']; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $date = new DateTime($entry['date']); |
| 123 | - $dateIndex = (int) $date->diff($startObj)->format("%a"); |
|
| 124 | - $timeline[$entry['tool']][$dateIndex] = (int) $entry['count']; |
|
| 123 | + $dateIndex = (int)$date->diff($startObj)->format("%a"); |
|
| 124 | + $timeline[$entry['tool']][$dateIndex] = (int)$entry['count']; |
|
| 125 | 125 | |
| 126 | 126 | $grandSum += $entry['count']; |
| 127 | 127 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | $timeline = []; |
| 160 | 160 | $startObj = new DateTime($start); |
| 161 | 161 | $endObj = new DateTime($end); |
| 162 | - $numDays = (int) $endObj->diff($startObj)->format("%a"); |
|
| 162 | + $numDays = (int)$endObj->diff($startObj)->format("%a"); |
|
| 163 | 163 | $grandSum = 0; |
| 164 | 164 | |
| 165 | 165 | // Generate array of date labels |
@@ -169,17 +169,17 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | foreach ($data as $entry) { |
| 171 | 171 | if (!isset($totals[$entry['endpoint']])) { |
| 172 | - $totals[$entry['endpoint']] = (int) $entry['count']; |
|
| 172 | + $totals[$entry['endpoint']] = (int)$entry['count']; |
|
| 173 | 173 | |
| 174 | 174 | // Create arrays for each endpoint, filled with zeros for each date in the timeline |
| 175 | 175 | $timeline[$entry['endpoint']] = array_fill(0, $numDays, 0); |
| 176 | 176 | } else { |
| 177 | - $totals[$entry['endpoint']] += (int) $entry['count']; |
|
| 177 | + $totals[$entry['endpoint']] += (int)$entry['count']; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | $date = new DateTime($entry['date']); |
| 181 | - $dateIndex = (int) $date->diff($startObj)->format("%a"); |
|
| 182 | - $timeline[$entry['endpoint']][$dateIndex] = (int) $entry['count']; |
|
| 181 | + $dateIndex = (int)$date->diff($startObj)->format("%a"); |
|
| 182 | + $timeline[$entry['endpoint']][$dateIndex] = (int)$entry['count']; |
|
| 183 | 183 | |
| 184 | 184 | $grandSum += $entry['count']; |
| 185 | 185 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | |
| 232 | 232 | /** @var Connection $conn */ |
| 233 | 233 | $conn = $this->container->get('doctrine')->getManager('default')->getConnection(); |
| 234 | - $date = date('Y-m-d'); |
|
| 234 | + $date = date('Y-m-d'); |
|
| 235 | 235 | |
| 236 | 236 | // Tool name needs to be lowercase. |
| 237 | 237 | $tool = strtolower($tool); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace App\Controller; |
| 5 | 5 | |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $this->project = $defaultProject; |
| 192 | 192 | |
| 193 | 193 | $results = $globalContribs->globalEdits(); |
| 194 | - $results = array_map(function (Edit $edit) { |
|
| 194 | + $results = array_map(function(Edit $edit) { |
|
| 195 | 195 | return $edit->getForJson(true, true); |
| 196 | 196 | }, array_values($results)); |
| 197 | 197 | $results = $this->addFullPageTitlesAndContinue('globalcontribs', [], $results); |
@@ -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 App\Repository; |
| 9 | 9 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | $sql = "SELECT log_action, log_type, log_timestamp AS 'timestamp' |
| 99 | 99 | FROM $loggingTable |
| 100 | - WHERE log_namespace = '" . $page->getNamespace() . "' |
|
| 100 | + WHERE log_namespace = '".$page->getNamespace()."' |
|
| 101 | 101 | AND log_title = :title AND log_timestamp > 1 $datesConditions |
| 102 | 102 | AND log_type IN ('delete', 'move', 'protect', 'stable')"; |
| 103 | 103 | $title = str_replace(' ', '_', $page->getTitle()); |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $time2 = time(); |
| 280 | 280 | |
| 281 | 281 | // If it took over 5 seconds, cache the result for 20 minutes. |
| 282 | - if ($time2 - $time1 > 5) { |
|
| 282 | + if ($time2-$time1 > 5) { |
|
| 283 | 283 | $this->setCache($cacheKey, $result, 'PT20M'); |
| 284 | 284 | } |
| 285 | 285 | |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the ProjectRepository class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace App\Repository; |
| 9 | 9 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if ($this->container->hasParameter("database_meta_table")) { |
| 126 | - $table = $this->container->getParameter('database_meta_name') . '.' . |
|
| 126 | + $table = $this->container->getParameter('database_meta_name').'.'. |
|
| 127 | 127 | $this->container->getParameter('database_meta_table'); |
| 128 | 128 | } else { |
| 129 | 129 | $table = "meta_p.wiki"; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | || $projMetadata['url'] == "https://$project" |
| 172 | 172 | || $projMetadata['url'] == "https://$project.org" |
| 173 | 173 | || $projMetadata['url'] == "https://www.$project") { |
| 174 | - $this->log->debug(__METHOD__ . " Using cached data for $project"); |
|
| 174 | + $this->log->debug(__METHOD__." Using cached data for $project"); |
|
| 175 | 175 | return $projMetadata; |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | if ($this->container->hasParameter("database_meta_table")) { |
| 185 | - $table = $this->container->getParameter('database_meta_name') . '.' . |
|
| 185 | + $table = $this->container->getParameter('database_meta_name').'.'. |
|
| 186 | 186 | $this->container->getParameter('database_meta_table'); |
| 187 | 187 | } else { |
| 188 | 188 | $table = "meta_p.wiki"; |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | $optedIn = $this->container->getParameter('opted_in'); |
| 327 | 327 | // In case there's just one given. |
| 328 | 328 | if (!is_array($optedIn)) { |
| 329 | - $optedIn = [ $optedIn ]; |
|
| 329 | + $optedIn = [$optedIn]; |
|
| 330 | 330 | } |
| 331 | 331 | return $optedIn; |
| 332 | 332 | } |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | ]])->getBody()->getContents(), true); |
| 396 | 396 | |
| 397 | 397 | $extensions = $res['query']['extensions'] ?? []; |
| 398 | - return array_map(function ($extension) { |
|
| 398 | + return array_map(function($extension) { |
|
| 399 | 399 | return $extension['name']; |
| 400 | 400 | }, $extensions); |
| 401 | 401 | } |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace App\Repository; |
| 5 | 5 | |