@@ -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\EventSubscriber; |
| 6 | 6 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $cacheItem = $this->cache->getItem($cacheKey); |
| 141 | 141 | |
| 142 | 142 | // If increment value already in cache, or start with 1. |
| 143 | - $count = $cacheItem->isHit() ? (int) $cacheItem->get() + 1 : 1; |
|
| 143 | + $count = $cacheItem->isHit() ? (int)$cacheItem->get()+1 : 1; |
|
| 144 | 144 | |
| 145 | 145 | // Check if limit has been exceeded, and if so, throw an error. |
| 146 | 146 | if ($count > $this->rateLimit) { |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $cacheItem = $this->cache->getItem($cacheKey); |
| 181 | 181 | |
| 182 | 182 | // If increment value already in cache, or start with 1. |
| 183 | - $count = $cacheItem->isHit() ? (int)$cacheItem->get() + 1 : 1; |
|
| 183 | + $count = $cacheItem->isHit() ? (int)$cacheItem->get()+1 : 1; |
|
| 184 | 184 | |
| 185 | 185 | // Check if limit has been exceeded, and if so, add a log entry. |
| 186 | 186 | if ($count > 3) { |
@@ -255,8 +255,8 @@ discard block |
||
| 255 | 255 | $message = $this->i18n->msg('error-rate-limit', [ |
| 256 | 256 | $this->rateDuration, |
| 257 | 257 | "<a href='/login'>".$this->i18n->msg('error-rate-limit-login')."</a>", |
| 258 | - "<a href='https://www.mediawiki.org/wiki/Special:MyLanguage/XTools/API' target='_blank'>" . |
|
| 259 | - $this->i18n->msg('api') . |
|
| 258 | + "<a href='https://www.mediawiki.org/wiki/Special:MyLanguage/XTools/API' target='_blank'>". |
|
| 259 | + $this->i18n->msg('api'). |
|
| 260 | 260 | "</a>", |
| 261 | 261 | ]); |
| 262 | 262 | |
@@ -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,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,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,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,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 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $revDateConditions = $this->getDateConditions($start, $end, false, "$ipcTable.", 'ipc_rev_timestamp'); |
| 120 | 120 | [$startHex, $endHex] = IPUtils::parseRange($user->getUsername()); |
| 121 | 121 | |
| 122 | - $revNamespaceJoinSql = 'all' === $namespace ? '' : "JOIN $revTable ON rev_id = ipc_rev_id " . |
|
| 122 | + $revNamespaceJoinSql = 'all' === $namespace ? '' : "JOIN $revTable ON rev_id = ipc_rev_id ". |
|
| 123 | 123 | "JOIN $pageTable ON rev_page = page_id"; |
| 124 | 124 | $revNamespaceWhereSql = 'all' === $namespace ? '' : "AND page_namespace = $namespace"; |
| 125 | 125 | |
@@ -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 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | return $this->cache->getItem($cacheKey)->get(); |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - $rightsPaths = array_map(function ($right) { |
|
| 116 | + $rightsPaths = array_map(function($right) { |
|
| 117 | 117 | return "Group-$right-member"; |
| 118 | 118 | }, $this->getRawRightsNames($project)); |
| 119 | 119 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | FROM $revisionTable |
| 257 | 257 | WHERE rev_actor = :actorId |
| 258 | 258 | AND rev_timestamp >= $offset |
| 259 | - LIMIT 1 OFFSET ".($edits - 1); |
|
| 259 | + LIMIT 1 OFFSET ".($edits-1); |
|
| 260 | 260 | |
| 261 | 261 | $ret = $this->executeProjectsQuery($project, $sql, [ |
| 262 | 262 | 'actorId' => $user->getActorId($project), |
@@ -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 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | if ('all' !== $namespace) { |
| 53 | 53 | // Limit by namespace. |
| 54 | - return array_filter($this->aeTools, function (array $tool) use ($namespace) { |
|
| 54 | + return array_filter($this->aeTools, function(array $tool) use ($namespace) { |
|
| 55 | 55 | return empty($tool['namespaces']) || |
| 56 | 56 | in_array((int)$namespace, $tool['namespaces']) || |
| 57 | 57 | ( |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | $tagJoin = "LEFT OUTER JOIN $tagTable ON ct_rev_id = rev_id"; |
| 148 | 148 | $condTools[] = "ct_tag_id IN ($tagIds)"; |
| 149 | 149 | } |
| 150 | - $condTool = 'AND (' . implode(' OR ', $condTools) . ')'; |
|
| 150 | + $condTool = 'AND ('.implode(' OR ', $condTools).')'; |
|
| 151 | 151 | |
| 152 | 152 | $sql = "SELECT COUNT(DISTINCT(rev_id)) |
| 153 | 153 | FROM $revisionTable |
@@ -392,8 +392,8 @@ discard block |
||
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | // Sort the array by count |
| 395 | - uasort($results, function ($a, $b) { |
|
| 396 | - return $b['count'] - $a['count']; |
|
| 395 | + uasort($results, function($a, $b) { |
|
| 396 | + return $b['count']-$a['count']; |
|
| 397 | 397 | }); |
| 398 | 398 | |
| 399 | 399 | // Cache and return. |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | if (isset($values['tags'])) { |
| 585 | 585 | $tags = array_merge( |
| 586 | 586 | $tags, |
| 587 | - array_map(function ($tag) use ($conn) { |
|
| 587 | + array_map(function($tag) use ($conn) { |
|
| 588 | 588 | return $conn->quote($tag, PDO::PARAM_STR); |
| 589 | 589 | }, $values['tags']) |
| 590 | 590 | ); |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | |
| 619 | 619 | if ($tagExcludes && 1 === count($tagIds)) { |
| 620 | 620 | // Get tag IDs, filtering out those for which no ID exists (meaning there is no local tag for that tool). |
| 621 | - $excludesList = implode(',', array_filter(array_map(function ($tagName) use ($project) { |
|
| 621 | + $excludesList = implode(',', array_filter(array_map(function($tagName) use ($project) { |
|
| 622 | 622 | return $this->getTags($project)[$tagName] ?? null; |
| 623 | 623 | }, $tagExcludes))); |
| 624 | 624 | |