@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace App\Model; |
| 5 | 5 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace App\Twig; |
| 6 | 6 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | public function requestTime(): float |
| 118 | 118 | { |
| 119 | 119 | if (!isset($this->requestTime)) { |
| 120 | - $this->requestTime = microtime(true) - $this->getRequest()->server->get('REQUEST_TIME_FLOAT'); |
|
| 120 | + $this->requestTime = microtime(true)-$this->getRequest()->server->get('REQUEST_TIME_FLOAT'); |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | return $this->requestTime; |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | $sizeMessage = $this->numberFormat( |
| 547 | - pow(1024, $base - floor($base)), |
|
| 547 | + pow(1024, $base-floor($base)), |
|
| 548 | 548 | $precision |
| 549 | 549 | ); |
| 550 | 550 | |
@@ -701,15 +701,15 @@ discard block |
||
| 701 | 701 | |
| 702 | 702 | if ($seconds >= 86400) { |
| 703 | 703 | // Over a day |
| 704 | - $val = (int) floor($seconds / 86400); |
|
| 704 | + $val = (int)floor($seconds / 86400); |
|
| 705 | 705 | $key = 'days'; |
| 706 | 706 | } elseif ($seconds >= 3600) { |
| 707 | 707 | // Over an hour, less than a day |
| 708 | - $val = (int) floor($seconds / 3600); |
|
| 708 | + $val = (int)floor($seconds / 3600); |
|
| 709 | 709 | $key = 'hours'; |
| 710 | 710 | } elseif ($seconds >= 60) { |
| 711 | 711 | // Over a minute, less than an hour |
| 712 | - $val = (int) floor($seconds / 60); |
|
| 712 | + $val = (int)floor($seconds / 60); |
|
| 713 | 713 | $key = 'minutes'; |
| 714 | 714 | } |
| 715 | 715 | |
@@ -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\EventSubscriber; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace App\Model; |
| 6 | 6 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $this->repository = $repository; |
| 49 | 49 | $this->project = $project; |
| 50 | 50 | $this->user = $user; |
| 51 | - $this->categories = array_map(function ($category) { |
|
| 51 | + $this->categories = array_map(function($category) { |
|
| 52 | 52 | return str_replace(' ', '_', $category); |
| 53 | 53 | }, $categories); |
| 54 | 54 | $this->start = $start; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function getCategoriesNormalized(): array |
| 82 | 82 | { |
| 83 | - return array_map(function ($category) { |
|
| 83 | + return array_map(function($category) { |
|
| 84 | 84 | return str_replace('_', ' ', $category); |
| 85 | 85 | }, $this->categories); |
| 86 | 86 | } |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | throw new XtoolsHttpException( |
| 297 | 297 | $this->i18n->msg('not-opted-in', [ |
| 298 | 298 | $this->getOptedInPage()->getTitle(), |
| 299 | - $this->i18n->msg('not-opted-in-link') . |
|
| 299 | + $this->i18n->msg('not-opted-in-link'). |
|
| 300 | 300 | ' <https://www.mediawiki.org/wiki/Special:MyLanguage/XTools/Edit_Counter#restricted_stats>', |
| 301 | 301 | $this->i18n->msg('not-opted-in-login'), |
| 302 | 302 | ]), |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | } |
| 572 | 572 | |
| 573 | 573 | throw new XtoolsHttpException( |
| 574 | - $this->i18n->msg('too-many-edits', [ $user->maxEdits() ]), |
|
| 574 | + $this->i18n->msg('too-many-edits', [$user->maxEdits()]), |
|
| 575 | 575 | $this->generateUrl($this->tooHighEditCountRoute(), $this->params), |
| 576 | 576 | $originalParams, |
| 577 | 577 | $this->isApi |
@@ -713,7 +713,7 @@ discard block |
||
| 713 | 713 | $params = $this->convertLegacyParams($params); |
| 714 | 714 | |
| 715 | 715 | // Remove blank values. |
| 716 | - return array_filter($params, function ($param) { |
|
| 716 | + return array_filter($params, function($param) { |
|
| 717 | 717 | // 'namespace' or 'username' could be '0'. |
| 718 | 718 | return null !== $param && '' !== $param; |
| 719 | 719 | }); |
@@ -771,7 +771,7 @@ discard block |
||
| 771 | 771 | // Show warnings that the date range was truncated. |
| 772 | 772 | $this->addFlashMessage('warning', 'date-range-too-wide', [$this->maxDays()]); |
| 773 | 773 | |
| 774 | - $startTime = strtotime('-' . $this->maxDays() . ' days', $endTime); |
|
| 774 | + $startTime = strtotime('-'.$this->maxDays().' days', $endTime); |
|
| 775 | 775 | } |
| 776 | 776 | |
| 777 | 777 | return [$startTime, $endTime]; |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | } |
| 912 | 912 | |
| 913 | 913 | $elapsedTime = round( |
| 914 | - microtime(true) - $this->request->server->get('REQUEST_TIME_FLOAT'), |
|
| 914 | + microtime(true)-$this->request->server->get('REQUEST_TIME_FLOAT'), |
|
| 915 | 915 | 3 |
| 916 | 916 | ); |
| 917 | 917 | |
@@ -952,7 +952,7 @@ discard block |
||
| 952 | 952 | public function addFullPageTitlesAndContinue(string $key, array $out, array $data): array |
| 953 | 953 | { |
| 954 | 954 | // Add full_page_title (in addition to the existing page_title and page_namespace keys). |
| 955 | - $out[$key] = array_map(function ($rev) { |
|
| 955 | + $out[$key] = array_map(function($rev) { |
|
| 956 | 956 | return array_merge([ |
| 957 | 957 | 'full_page_title' => $this->getPageFromNsAndTitle( |
| 958 | 958 | (int)$rev['page_namespace'], |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | string $centralAuthProject |
| 67 | 67 | ): RedirectResponse { |
| 68 | 68 | try { |
| 69 | - [ $next, $token ] = $this->getOauthClient($request, $projectRepo, $centralAuthProject)->initiate(); |
|
| 69 | + [$next, $token] = $this->getOauthClient($request, $projectRepo, $centralAuthProject)->initiate(); |
|
| 70 | 70 | } catch (Exception $oauthException) { |
| 71 | 71 | throw $oauthException; |
| 72 | 72 | // @TODO Make this work. |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | . '?title=Special:OAuth'; |
| 156 | 156 | $conf = new ClientConfig($endpoint); |
| 157 | 157 | $consumerKey = $this->getParameter('oauth_key'); |
| 158 | - $consumerSecret = $this->getParameter('oauth_secret'); |
|
| 158 | + $consumerSecret = $this->getParameter('oauth_secret'); |
|
| 159 | 159 | $conf->setConsumer(new Consumer($consumerKey, $consumerSecret)); |
| 160 | 160 | $this->oauthClient = new Client($conf); |
| 161 | 161 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace App\Repository; |
| 6 | 6 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | if ($this->parameterBag->has("database_meta_table")) { |
| 167 | - $table = $this->parameterBag->get('database_meta_name') . '.' . |
|
| 167 | + $table = $this->parameterBag->get('database_meta_name').'.'. |
|
| 168 | 168 | $this->parameterBag->get('database_meta_table'); |
| 169 | 169 | } else { |
| 170 | 170 | $table = "meta_p.wiki"; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | || $projMetadata['url'] == "https://$project" |
| 214 | 214 | || $projMetadata['url'] == "https://$project.org" |
| 215 | 215 | || $projMetadata['url'] == "https://www.$project") { |
| 216 | - $this->logger->debug(__METHOD__ . " Using cached data for $project"); |
|
| 216 | + $this->logger->debug(__METHOD__." Using cached data for $project"); |
|
| 217 | 217 | return $projMetadata; |
| 218 | 218 | } |
| 219 | 219 | } |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | ]])->getBody()->getContents(), true); |
| 410 | 410 | |
| 411 | 411 | $extensions = $res['query']['extensions'] ?? []; |
| 412 | - return array_map(function ($extension) { |
|
| 412 | + return array_map(function($extension) { |
|
| 413 | 413 | return $extension['name']; |
| 414 | 414 | }, $extensions); |
| 415 | 415 | } |
@@ -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 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types = 1); |
|
| 3 | +declare(strict_types=1); |
|
| 4 | 4 | |
| 5 | 5 | namespace App\Repository; |
| 6 | 6 | |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | // $tableExtension in order to generate the new table name |
| 210 | 210 | if ($this->isWMF && null !== $tableExtension) { |
| 211 | 211 | $mapped = true; |
| 212 | - $tableName .=('' === $tableExtension ? '' : '_'.$tableExtension); |
|
| 212 | + $tableName .= ('' === $tableExtension ? '' : '_'.$tableExtension); |
|
| 213 | 213 | } elseif ($this->parameterBag->has("app.table.$tableName")) { |
| 214 | 214 | // Use the table specified in the table mapping configuration, if present. |
| 215 | 215 | $mapped = true; |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | // This is a safeguard in case table mapping isn't properly set up. |
| 222 | 222 | $isLoggingOrRevision = in_array($tableName, ['revision', 'logging', 'archive']); |
| 223 | 223 | if (!$mapped && $isLoggingOrRevision && $this->isWMF) { |
| 224 | - $tableName .="_userindex"; |
|
| 224 | + $tableName .= "_userindex"; |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | // Figure out database name. |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | $offset = date('YmdHis', $offset); |
| 341 | 341 | $datesConditions .= " AND $tableAlias{$field} <= '$offset'"; |
| 342 | 342 | } elseif (is_int($end)) { |
| 343 | - $end = date('Ymd', $end) . '235959'; |
|
| 343 | + $end = date('Ymd', $end).'235959'; |
|
| 344 | 344 | $datesConditions .= " AND $tableAlias{$field} <= '$end'"; |
| 345 | 345 | } |
| 346 | 346 | |