@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the RateLimitSubscriber class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\EventSubscriber; |
| 9 | 9 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $cacheItem = $this->cache->getItem($cacheKey); |
| 138 | 138 | |
| 139 | 139 | // If increment value already in cache, or start with 1. |
| 140 | - $count = $cacheItem->isHit() ? (int) $cacheItem->get() + 1 : 1; |
|
| 140 | + $count = $cacheItem->isHit() ? (int)$cacheItem->get()+1 : 1; |
|
| 141 | 141 | |
| 142 | 142 | // Check if limit has been exceeded, and if so, throw an error. |
| 143 | 143 | if ($count > $this->rateLimit) { |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $cacheItem = $this->cache->getItem($cacheKey); |
| 178 | 178 | |
| 179 | 179 | // If increment value already in cache, or start with 1. |
| 180 | - $count = $cacheItem->isHit() ? (int)$cacheItem->get() + 1 : 1; |
|
| 180 | + $count = $cacheItem->isHit() ? (int)$cacheItem->get()+1 : 1; |
|
| 181 | 181 | |
| 182 | 182 | // Check if limit has been exceeded, and if so, add a log entry. |
| 183 | 183 | if ($count > 3) { |
@@ -252,8 +252,8 @@ discard block |
||
| 252 | 252 | $message = $this->i18n->msg('error-rate-limit', [ |
| 253 | 253 | $this->rateDuration, |
| 254 | 254 | "<a href='/login'>".$this->i18n->msg('error-rate-limit-login')."</a>", |
| 255 | - "<a href='https://www.mediawiki.org/wiki/Special:MyLanguage/XTools/API' target='_blank'>" . |
|
| 256 | - $this->i18n->msg('api') . |
|
| 255 | + "<a href='https://www.mediawiki.org/wiki/Special:MyLanguage/XTools/API' target='_blank'>". |
|
| 256 | + $this->i18n->msg('api'). |
|
| 257 | 257 | "</a>", |
| 258 | 258 | ]); |
| 259 | 259 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | throw new XtoolsHttpException( |
| 203 | 203 | $this->i18n->msg('not-opted-in', [ |
| 204 | 204 | $this->getOptedInPage()->getTitle(), |
| 205 | - $this->i18n->msg('not-opted-in-link') . |
|
| 205 | + $this->i18n->msg('not-opted-in-link'). |
|
| 206 | 206 | ' <https://www.mediawiki.org/wiki/XTools/Edit_Counter#restricted_stats>', |
| 207 | 207 | $this->i18n->msg('not-opted-in-login'), |
| 208 | 208 | ]), |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | $params = $this->convertLegacyParams($params); |
| 643 | 643 | |
| 644 | 644 | // Remove blank values. |
| 645 | - return array_filter($params, function ($param) { |
|
| 645 | + return array_filter($params, function($param) { |
|
| 646 | 646 | // 'namespace' or 'username' could be '0'. |
| 647 | 647 | return null !== $param && '' !== $param; |
| 648 | 648 | }); |
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | } |
| 844 | 844 | |
| 845 | 845 | $elapsedTime = round( |
| 846 | - microtime(true) - $this->request->server->get('REQUEST_TIME_FLOAT'), |
|
| 846 | + microtime(true)-$this->request->server->get('REQUEST_TIME_FLOAT'), |
|
| 847 | 847 | 3 |
| 848 | 848 | ); |
| 849 | 849 | |
@@ -886,7 +886,7 @@ discard block |
||
| 886 | 886 | $conn = $this->container->get('doctrine') |
| 887 | 887 | ->getManager('default') |
| 888 | 888 | ->getConnection(); |
| 889 | - $date = date('Y-m-d'); |
|
| 889 | + $date = date('Y-m-d'); |
|
| 890 | 890 | |
| 891 | 891 | // Increment count in timeline |
| 892 | 892 | $existsSql = "SELECT 1 FROM usage_api_timeline |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the SimpleEditCounterRepository class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Repository; |
| 9 | 9 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $revDateConditions = $this->getDateConditions($start, $end, false, "$ipcTable.", 'ipc_rev_timestamp'); |
| 124 | 124 | [$startHex, $endHex] = IPUtils::parseRange($user->getUsername()); |
| 125 | 125 | |
| 126 | - $revNamespaceJoinSql = 'all' === $namespace ? '' : "JOIN $revTable ON rev_id = ipc_rev_id " . |
|
| 126 | + $revNamespaceJoinSql = 'all' === $namespace ? '' : "JOIN $revTable ON rev_id = ipc_rev_id ". |
|
| 127 | 127 | "JOIN $pageTable ON rev_page = page_id"; |
| 128 | 128 | $revNamespaceWhereSql = 'all' === $namespace ? '' : "AND page_namespace = $namespace"; |
| 129 | 129 | |