@@ -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 | ]), |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 582 | throw new XtoolsHttpException( |
| 583 | - $this->i18n->msg('too-many-edits', [ $user->maxEdits() ]), |
|
| 583 | + $this->i18n->msg('too-many-edits', [$user->maxEdits()]), |
|
| 584 | 584 | $this->generateUrl($this->tooHighEditCountRoute(), $this->params), |
| 585 | 585 | $originalParams, |
| 586 | 586 | $this->isApi, |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | $params = $this->convertLegacyParams($params); |
| 729 | 729 | |
| 730 | 730 | // Remove blank values. |
| 731 | - return array_filter($params, function ($param) { |
|
| 731 | + return array_filter($params, function($param) { |
|
| 732 | 732 | // 'namespace' or 'username' could be '0'. |
| 733 | 733 | return null !== $param && '' !== $param; |
| 734 | 734 | }); |
@@ -786,7 +786,7 @@ discard block |
||
| 786 | 786 | // Show warnings that the date range was truncated. |
| 787 | 787 | $this->addFlashMessage('warning', 'date-range-too-wide', [$this->maxDays()]); |
| 788 | 788 | |
| 789 | - $startTime = strtotime('-' . $this->maxDays() . ' days', $endTime); |
|
| 789 | + $startTime = strtotime('-'.$this->maxDays().' days', $endTime); |
|
| 790 | 790 | } |
| 791 | 791 | |
| 792 | 792 | return [$startTime, $endTime]; |
@@ -958,7 +958,7 @@ discard block |
||
| 958 | 958 | } |
| 959 | 959 | |
| 960 | 960 | $elapsedTime = round( |
| 961 | - microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], |
|
| 961 | + microtime(true)-$_SERVER['REQUEST_TIME_FLOAT'], |
|
| 962 | 962 | 3 |
| 963 | 963 | ); |
| 964 | 964 | return array_merge($params, ['elapsed_time' => $elapsedTime]); |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | public function addFullPageTitlesAndContinue(string $key, array $out, array $data): array |
| 989 | 989 | { |
| 990 | 990 | // Add full_page_title (in addition to the existing page_title and namespace keys). |
| 991 | - $out[$key] = array_map(function ($rev) { |
|
| 991 | + $out[$key] = array_map(function($rev) { |
|
| 992 | 992 | return array_merge([ |
| 993 | 993 | 'full_page_title' => $this->getPageFromNsAndTitle( |
| 994 | 994 | (int)$rev['namespace'], |
@@ -1060,7 +1060,7 @@ discard block |
||
| 1060 | 1060 | */ |
| 1061 | 1061 | protected function addApiWarningAboutDates(array $keys): void |
| 1062 | 1062 | { |
| 1063 | - $this->addFlash('warning', 'In XTools 3.20, the ' . $this->i18n->getIntuition()->listToText($keys) . |
|
| 1063 | + $this->addFlash('warning', 'In XTools 3.20, the '.$this->i18n->getIntuition()->listToText($keys). |
|
| 1064 | 1064 | ' properties will be returned in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ'); |
| 1065 | 1065 | } |
| 1066 | 1066 | |
@@ -1069,7 +1069,7 @@ discard block |
||
| 1069 | 1069 | */ |
| 1070 | 1070 | protected function addApiWarningAboutPageTitles(): void |
| 1071 | 1071 | { |
| 1072 | - $this->addFlash('warning', 'In XTools 3.20, full_page_title and page_title will return ' . |
|
| 1072 | + $this->addFlash('warning', 'In XTools 3.20, full_page_title and page_title will return '. |
|
| 1073 | 1073 | 'page titles with spaces instead of underscores.'); |
| 1074 | 1074 | } |
| 1075 | 1075 | } |
@@ -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\Helper; |
| 6 | 6 | |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | // Find the path, and complain if English doesn't exist. |
| 57 | - $path = $this->projectDir . '/i18n'; |
|
| 57 | + $path = $this->projectDir.'/i18n'; |
|
| 58 | 58 | if (!file_exists("$path/en.json")) { |
| 59 | 59 | throw new Exception("Language directory doesn't exist: $path"); |
| 60 | 60 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $messageFiles = glob($this->projectDir.'/i18n/*.json'); |
| 106 | 106 | |
| 107 | 107 | $languages = array_values(array_unique(array_map( |
| 108 | - function ($filename) { |
|
| 108 | + function($filename) { |
|
| 109 | 109 | return basename($filename, '.json'); |
| 110 | 110 | }, |
| 111 | 111 | $messageFiles |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | $this->getIntuition()->getLangFallbacks($useLang) |
| 150 | 150 | ); |
| 151 | 151 | |
| 152 | - return array_filter($fallbacks, function ($lang) use ($i18nPath) { |
|
| 152 | + return array_filter($fallbacks, function($lang) use ($i18nPath) { |
|
| 153 | 153 | return is_file($i18nPath.$lang.'.json'); |
| 154 | 154 | }); |
| 155 | 155 | } |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | */ |
| 288 | 288 | private function getLangForTranslatingNumerals(): string |
| 289 | 289 | { |
| 290 | - return 'ar' === $this->getIntuition()->getLang() ? 'en': $this->getIntuition()->getLang(); |
|
| 290 | + return 'ar' === $this->getIntuition()->getLang() ? 'en' : $this->getIntuition()->getLang(); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | /** |