@@ -72,7 +72,7 @@ |
||
| 72 | 72 | /** |
| 73 | 73 | * Unique identifier for this Edit, to be used in cache keys. |
| 74 | 74 | * @see Repository::getCacheKey() |
| 75 | - * @return string |
|
| 75 | + * @return integer |
|
| 76 | 76 | */ |
| 77 | 77 | public function getCacheKey() |
| 78 | 78 | { |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | $this->stopwatch->start($cacheKey, 'XTools'); |
| 125 | 125 | $api = $this->getMediawikiApi($project); |
| 126 | - $params = [ "list"=>"users", "ususers"=>$username, "usprop"=>"groups" ]; |
|
| 126 | + $params = ["list"=>"users", "ususers"=>$username, "usprop"=>"groups"]; |
|
| 127 | 127 | $query = new SimpleRequest('query', $params); |
| 128 | 128 | $result = []; |
| 129 | 129 | $res = $api->getRequest($query); |
@@ -258,8 +258,8 @@ discard block |
||
| 258 | 258 | FROM $pageTable |
| 259 | 259 | JOIN $revisionTable ON page_id = rev_page |
| 260 | 260 | $paJoin |
| 261 | - WHERE $whereRev AND rev_parent_id = '0' $namespaceConditionRev $redirectCondition" . |
|
| 262 | - ($hasPageAssessments ? 'GROUP BY rev_page' : '') . " |
|
| 261 | + WHERE $whereRev AND rev_parent_id = '0' $namespaceConditionRev $redirectCondition". |
|
| 262 | + ($hasPageAssessments ? 'GROUP BY rev_page' : '')." |
|
| 263 | 263 | ) |
| 264 | 264 | |
| 265 | 265 | UNION |
@@ -378,14 +378,14 @@ discard block |
||
| 378 | 378 | $condEnd = ''; |
| 379 | 379 | |
| 380 | 380 | if (!empty($start)) { |
| 381 | - $cacheKey .= '.' . $start; |
|
| 381 | + $cacheKey .= '.'.$start; |
|
| 382 | 382 | |
| 383 | 383 | // For the query |
| 384 | 384 | $start = date('Ymd000000', strtotime($start)); |
| 385 | 385 | $condBegin = 'AND rev_timestamp >= :start '; |
| 386 | 386 | } |
| 387 | 387 | if (!empty($end)) { |
| 388 | - $cacheKey .= '.' . $end; |
|
| 388 | + $cacheKey .= '.'.$end; |
|
| 389 | 389 | |
| 390 | 390 | // For the query |
| 391 | 391 | $end = date('Ymd235959', strtotime($end)); |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | $tagJoin = $tags != '' ? "LEFT OUTER JOIN $tagTable ON ct_rev_id = rev_id" : ''; |
| 415 | 415 | $condTools[] = "ct_tag IN ($tags)"; |
| 416 | 416 | } |
| 417 | - $condTool = 'AND (' . implode(' OR ', $condTools) . ')'; |
|
| 417 | + $condTool = 'AND ('.implode(' OR ', $condTools).')'; |
|
| 418 | 418 | |
| 419 | 419 | $sql = "SELECT COUNT(DISTINCT(rev_id)) |
| 420 | 420 | FROM $revisionTable |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | $resultQuery->bindParam('namespace', $namespace); |
| 440 | 440 | } |
| 441 | 441 | $resultQuery->execute(); |
| 442 | - $result = (int) $resultQuery->fetchColumn(); |
|
| 442 | + $result = (int)$resultQuery->fetchColumn(); |
|
| 443 | 443 | |
| 444 | 444 | // Cache for 10 minutes, and return. |
| 445 | 445 | $cacheItem = $this->cache->getItem($cacheKey) |
@@ -627,13 +627,13 @@ discard block |
||
| 627 | 627 | if ($condTool === '') { |
| 628 | 628 | $condTool = "ct_tag = $tag"; |
| 629 | 629 | } else { |
| 630 | - $condTool = '(' . $condTool . " OR ct_tag = $tag)"; |
|
| 630 | + $condTool = '('.$condTool." OR ct_tag = $tag)"; |
|
| 631 | 631 | } |
| 632 | 632 | } |
| 633 | 633 | |
| 634 | 634 | // Developer error, no regex or tag provided for this tool. |
| 635 | 635 | if ($condTool === '') { |
| 636 | - throw new Exception("No regex or tag found for the tool $toolname. " . |
|
| 636 | + throw new Exception("No regex or tag found for the tool $toolname. ". |
|
| 637 | 637 | "Please verify this entry in semi_automated.yml"); |
| 638 | 638 | } |
| 639 | 639 | |
@@ -685,8 +685,8 @@ discard block |
||
| 685 | 685 | } |
| 686 | 686 | |
| 687 | 687 | // Sort the array by count |
| 688 | - uasort($results, function ($a, $b) { |
|
| 689 | - return $b['count'] - $a['count']; |
|
| 688 | + uasort($results, function($a, $b) { |
|
| 689 | + return $b['count']-$a['count']; |
|
| 690 | 690 | }); |
| 691 | 691 | |
| 692 | 692 | // Cache for 10 minutes, and return. |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | || $projMetadata['url'] == "https://$project" |
| 150 | 150 | || $projMetadata['url'] == "https://$project.org" |
| 151 | 151 | || $projMetadata['url'] == "https://www.$project") { |
| 152 | - $this->log->debug(__METHOD__ . " Using cached data for $project"); |
|
| 152 | + $this->log->debug(__METHOD__." Using cached data for $project"); |
|
| 153 | 153 | return $projMetadata; |
| 154 | 154 | } |
| 155 | 155 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | $optedIn = $this->container->getParameter('opted_in'); |
| 293 | 293 | // In case there's just one given. |
| 294 | 294 | if (!is_array($optedIn)) { |
| 295 | - $optedIn = [ $optedIn ]; |
|
| 295 | + $optedIn = [$optedIn]; |
|
| 296 | 296 | } |
| 297 | 297 | return $optedIn; |
| 298 | 298 | } |