@@ -146,7 +146,7 @@ |
||
| 146 | 146 | |
| 147 | 147 | /** |
| 148 | 148 | * |
| 149 | - * @param $username |
|
| 149 | + * @param string $username |
|
| 150 | 150 | * @return integer |
| 151 | 151 | */ |
| 152 | 152 | public function getPageCounts($username, $totalRevisions) |
@@ -390,15 +390,15 @@ |
||
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | $sql = "SELECT " |
| 393 | - . " SUBSTR(CAST(rev_timestamp AS CHAR(6)), 1, 6) AS `month`," |
|
| 394 | - . " page_namespace," |
|
| 395 | - . " COUNT(rev_id) AS `count` " |
|
| 396 | - . " FROM ".$this->labsHelper->getTable('revision') |
|
| 397 | - . " JOIN " . $this->labsHelper->getTable('page') |
|
| 398 | - . " ON (rev_page = page_id)" |
|
| 399 | - . " WHERE rev_user_text = :username" |
|
| 400 | - . " GROUP BY SUBSTR(CAST(rev_timestamp AS CHAR(6)), 1, 6), page_namespace " |
|
| 401 | - . " ORDER BY rev_timestamp DESC "; |
|
| 393 | + . " SUBSTR(CAST(rev_timestamp AS CHAR(6)), 1, 6) AS `month`," |
|
| 394 | + . " page_namespace," |
|
| 395 | + . " COUNT(rev_id) AS `count` " |
|
| 396 | + . " FROM ".$this->labsHelper->getTable('revision') |
|
| 397 | + . " JOIN " . $this->labsHelper->getTable('page') |
|
| 398 | + . " ON (rev_page = page_id)" |
|
| 399 | + . " WHERE rev_user_text = :username" |
|
| 400 | + . " GROUP BY SUBSTR(CAST(rev_timestamp AS CHAR(6)), 1, 6), page_namespace " |
|
| 401 | + . " ORDER BY rev_timestamp DESC "; |
|
| 402 | 402 | $resultQuery = $this->replicas->prepare($sql); |
| 403 | 403 | $resultQuery->bindParam(":username", $username); |
| 404 | 404 | $resultQuery->execute(); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | public function getUserId($usernameOrIp) |
| 42 | 42 | { |
| 43 | 43 | // Use cache if possible. |
| 44 | - $cacheItem = $this->cache->getItem('ec.usernameOrIp.' . $usernameOrIp); |
|
| 44 | + $cacheItem = $this->cache->getItem('ec.usernameOrIp.'.$usernameOrIp); |
|
| 45 | 45 | if ($cacheItem->isHit()) { |
| 46 | 46 | return $cacheItem->get(); |
| 47 | 47 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | $topEditCounts = []; |
| 72 | 72 | foreach ($this->labsHelper->allProjects() as $project) { |
| 73 | - $cacheItem = $this->cache->getItem('editcounter.total.'.$project['dbName'].'.' . $username); |
|
| 73 | + $cacheItem = $this->cache->getItem('editcounter.total.'.$project['dbName'].'.'.$username); |
|
| 74 | 74 | if ($cacheItem->isHit()) { |
| 75 | 75 | // Use cache if possible. |
| 76 | 76 | $total = $cacheItem->get(); |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | } |
| 90 | 90 | $topEditCounts[$project['dbName']] = array_merge($project, ['total' => $total]); |
| 91 | 91 | } |
| 92 | - uasort($topEditCounts, function ($a, $b) { |
|
| 93 | - return $b['total'] - $a['total']; |
|
| 92 | + uasort($topEditCounts, function($a, $b) { |
|
| 93 | + return $b['total']-$a['total']; |
|
| 94 | 94 | }); |
| 95 | 95 | return array_slice($topEditCounts, 0, $numProjects); |
| 96 | 96 | } |
@@ -160,10 +160,10 @@ discard block |
||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | $revisionCounts = array_combine( |
| 163 | - array_map(function ($e) { |
|
| 163 | + array_map(function($e) { |
|
| 164 | 164 | return $e['source']; |
| 165 | 165 | }, $results), |
| 166 | - array_map(function ($e) { |
|
| 166 | + array_map(function($e) { |
|
| 167 | 167 | return $e['value']; |
| 168 | 168 | }, $results) |
| 169 | 169 | ); |
@@ -177,11 +177,11 @@ discard block |
||
| 177 | 177 | : 0; |
| 178 | 178 | |
| 179 | 179 | // Count the number of days, accounting for when there's only one edit. |
| 180 | - $editingTimeInSeconds = ceil($revisionCounts['last'] - $revisionCounts['first']); |
|
| 181 | - $revisionCounts['days'] = $editingTimeInSeconds ? $editingTimeInSeconds/(60*60*24) : 1; |
|
| 180 | + $editingTimeInSeconds = ceil($revisionCounts['last']-$revisionCounts['first']); |
|
| 181 | + $revisionCounts['days'] = $editingTimeInSeconds ? $editingTimeInSeconds / (60 * 60 * 24) : 1; |
|
| 182 | 182 | |
| 183 | 183 | // Sum deleted and live to make the total. |
| 184 | - $revisionCounts['total'] = $revisionCounts['deleted'] + $revisionCounts['live']; |
|
| 184 | + $revisionCounts['total'] = $revisionCounts['deleted']+$revisionCounts['live']; |
|
| 185 | 185 | |
| 186 | 186 | // Calculate the average number of live edits per day. |
| 187 | 187 | $revisionCounts['avg_per_day'] = round( |
@@ -222,16 +222,16 @@ discard block |
||
| 222 | 222 | $results = $resultQuery->fetchAll(); |
| 223 | 223 | |
| 224 | 224 | $pageCounts = array_combine( |
| 225 | - array_map(function ($e) { |
|
| 225 | + array_map(function($e) { |
|
| 226 | 226 | return $e['source']; |
| 227 | 227 | }, $results), |
| 228 | - array_map(function ($e) { |
|
| 228 | + array_map(function($e) { |
|
| 229 | 229 | return $e['value']; |
| 230 | 230 | }, $results) |
| 231 | 231 | ); |
| 232 | 232 | |
| 233 | 233 | // Total created. |
| 234 | - $pageCounts['created'] = $pageCounts['created-live'] + $pageCounts['created-deleted']; |
|
| 234 | + $pageCounts['created'] = $pageCounts['created-live']+$pageCounts['created-deleted']; |
|
| 235 | 235 | |
| 236 | 236 | // Calculate the average number of edits per page. |
| 237 | 237 | $pageCounts['edits_per_page'] = 0; |
@@ -258,17 +258,17 @@ discard block |
||
| 258 | 258 | $resultQuery->execute(); |
| 259 | 259 | $results = $resultQuery->fetchAll(); |
| 260 | 260 | $logCounts = array_combine( |
| 261 | - array_map(function ($e) { |
|
| 261 | + array_map(function($e) { |
|
| 262 | 262 | return $e['source']; |
| 263 | 263 | }, $results), |
| 264 | - array_map(function ($e) { |
|
| 264 | + array_map(function($e) { |
|
| 265 | 265 | return $e['value']; |
| 266 | 266 | }, $results) |
| 267 | 267 | ); |
| 268 | 268 | |
| 269 | 269 | // Make sure there is some value for each of the wanted counts. |
| 270 | 270 | $requiredCounts = [ |
| 271 | - 'thanks-thank', 'review-approve', 'patrol-patrol','block-block', 'block-unblock', |
|
| 271 | + 'thanks-thank', 'review-approve', 'patrol-patrol', 'block-block', 'block-unblock', |
|
| 272 | 272 | 'protect-protect', 'protect-unprotect', 'delete-delete', 'delete-revision', |
| 273 | 273 | 'delete-restore', 'import-import', 'upload-upload', 'upload-overwrite', |
| 274 | 274 | ]; |
@@ -279,9 +279,9 @@ discard block |
||
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | // Merge approvals together. |
| 282 | - $logCounts['review-approve'] = $logCounts['review-approve'] + |
|
| 283 | - (!empty($logCounts['review-approve-a']) ? $logCounts['review-approve-a'] : 0) + |
|
| 284 | - (!empty($logCounts['review-approve-i']) ? $logCounts['review-approve-i'] : 0) + |
|
| 282 | + $logCounts['review-approve'] = $logCounts['review-approve']+ |
|
| 283 | + (!empty($logCounts['review-approve-a']) ? $logCounts['review-approve-a'] : 0)+ |
|
| 284 | + (!empty($logCounts['review-approve-i']) ? $logCounts['review-approve-i'] : 0)+ |
|
| 285 | 285 | (!empty($logCounts['review-approve-ia']) ? $logCounts['review-approve-ia'] : 0); |
| 286 | 286 | |
| 287 | 287 | // Add Commons upload count, if applicable. |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | public function getNamespaceTotals($userId) |
| 307 | 307 | { |
| 308 | 308 | $sql = "SELECT page_namespace, count(rev_id) AS total |
| 309 | - FROM ".$this->labsHelper->getTable('revision') ." r |
|
| 309 | + FROM ".$this->labsHelper->getTable('revision')." r |
|
| 310 | 310 | JOIN ".$this->labsHelper->getTable('page')." p on r.rev_page = p.page_id |
| 311 | 311 | WHERE r.rev_user = :id GROUP BY page_namespace"; |
| 312 | 312 | $resultQuery = $this->replicas->prepare($sql); |
@@ -314,10 +314,10 @@ discard block |
||
| 314 | 314 | $resultQuery->execute(); |
| 315 | 315 | $results = $resultQuery->fetchAll(); |
| 316 | 316 | $namespaceTotals = array_combine( |
| 317 | - array_map(function ($e) { |
|
| 317 | + array_map(function($e) { |
|
| 318 | 318 | return $e['page_namespace']; |
| 319 | 319 | }, $results), |
| 320 | - array_map(function ($e) { |
|
| 320 | + array_map(function($e) { |
|
| 321 | 321 | return $e['total']; |
| 322 | 322 | }, $results) |
| 323 | 323 | ); |
@@ -342,8 +342,8 @@ discard block |
||
| 342 | 342 | $sql = |
| 343 | 343 | "SELECT rev_id, rev_comment, rev_timestamp, rev_minor_edit, rev_deleted, " |
| 344 | 344 | . " rev_len, rev_parent_id, page_title " |
| 345 | - . " FROM " . $this->labsHelper->getTable('revision', $project['dbName']) |
|
| 346 | - . " JOIN " . $this->labsHelper->getTable('page', $project['dbName']) |
|
| 345 | + . " FROM ".$this->labsHelper->getTable('revision', $project['dbName']) |
|
| 346 | + . " JOIN ".$this->labsHelper->getTable('page', $project['dbName']) |
|
| 347 | 347 | . " ON (rev_page = page_id)" |
| 348 | 348 | . " WHERE rev_timestamp > NOW() - INTERVAL $days DAY AND rev_user_text LIKE :username" |
| 349 | 349 | . " ORDER BY rev_timestamp DESC" |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | continue; |
| 361 | 361 | } |
| 362 | 362 | $revsWithProject = array_map( |
| 363 | - function (&$item) use ($project) { |
|
| 363 | + function(&$item) use ($project) { |
|
| 364 | 364 | $item['project_name'] = $project['name']; |
| 365 | 365 | $item['project_url'] = $project['url']; |
| 366 | 366 | $item['project_db_name'] = $project['dbName']; |
@@ -370,8 +370,8 @@ discard block |
||
| 370 | 370 | ); |
| 371 | 371 | $allRevisions = array_merge($allRevisions, $revsWithProject); |
| 372 | 372 | } |
| 373 | - usort($allRevisions, function ($a, $b) { |
|
| 374 | - return $b['rev_timestamp'] - $a['rev_timestamp']; |
|
| 373 | + usort($allRevisions, function($a, $b) { |
|
| 374 | + return $b['rev_timestamp']-$a['rev_timestamp']; |
|
| 375 | 375 | }); |
| 376 | 376 | return array_slice($allRevisions, 0, $contribCount); |
| 377 | 377 | } |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | . " page_namespace," |
| 395 | 395 | . " COUNT(rev_id) AS `count` " |
| 396 | 396 | . " FROM ".$this->labsHelper->getTable('revision') |
| 397 | - . " JOIN " . $this->labsHelper->getTable('page') |
|
| 397 | + . " JOIN ".$this->labsHelper->getTable('page') |
|
| 398 | 398 | . " ON (rev_page = page_id)" |
| 399 | 399 | . " WHERE rev_user_text = :username" |
| 400 | 400 | . " GROUP BY SUBSTR(CAST(rev_timestamp AS CHAR(6)), 1, 6), page_namespace " |
@@ -456,10 +456,10 @@ discard block |
||
| 456 | 456 | . " SUBSTR(CAST(rev_timestamp AS CHAR(4)), 1, 4) AS `year`," |
| 457 | 457 | . " page_namespace," |
| 458 | 458 | . " COUNT(rev_id) AS `count` " |
| 459 | - . " FROM " . $this->labsHelper->getTable('revision') |
|
| 460 | - . " JOIN " . $this->labsHelper->getTable('page') . " ON (rev_page = page_id)" . |
|
| 461 | - " WHERE rev_user_text = :username" . |
|
| 462 | - " GROUP BY SUBSTR(CAST(rev_timestamp AS CHAR(4)), 1, 4), page_namespace " . |
|
| 459 | + . " FROM ".$this->labsHelper->getTable('revision') |
|
| 460 | + . " JOIN ".$this->labsHelper->getTable('page')." ON (rev_page = page_id)". |
|
| 461 | + " WHERE rev_user_text = :username". |
|
| 462 | + " GROUP BY SUBSTR(CAST(rev_timestamp AS CHAR(4)), 1, 4), page_namespace ". |
|
| 463 | 463 | " ORDER BY rev_timestamp DESC "; |
| 464 | 464 | $resultQuery = $this->replicas->prepare($sql); |
| 465 | 465 | $resultQuery->bindParam(":username", $username); |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | . " DAYOFWEEK(rev_timestamp) AS `y`, " |
| 495 | 495 | . " $xCalc AS `x`, " |
| 496 | 496 | . " COUNT(rev_id) AS `r` " |
| 497 | - . " FROM " . $this->labsHelper->getTable('revision') |
|
| 497 | + . " FROM ".$this->labsHelper->getTable('revision') |
|
| 498 | 498 | . " WHERE rev_user_text = :username" |
| 499 | 499 | . " GROUP BY DAYOFWEEK(rev_timestamp), $xCalc " |
| 500 | 500 | . " "; |
@@ -4,10 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Doctrine\DBAL\Connection; |
| 6 | 6 | use Psr\Cache\CacheItemPoolInterface; |
| 7 | -use Symfony\Component\Config\Definition\Exception\Exception; |
|
| 8 | -use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; |
|
| 9 | 7 | use Symfony\Component\DependencyInjection\ContainerInterface; |
| 10 | -use Symfony\Component\VarDumper\VarDumper; |
|
| 11 | 8 | |
| 12 | 9 | class AutomatedEditsHelper |
| 13 | 10 | { |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | /** @var LabsHelper $labsHelper */ |
| 126 | 126 | $labsHelper = $this->container->get('app.labs_helper'); |
| 127 | 127 | $sql = "SELECT rev_comment FROM ".$labsHelper->getTable('revision') |
| 128 | - ." WHERE rev_user=:userId ORDER BY rev_timestamp DESC LIMIT 1000"; |
|
| 128 | + ." WHERE rev_user=:userId ORDER BY rev_timestamp DESC LIMIT 1000"; |
|
| 129 | 129 | $resultQuery = $replicas->prepare($sql); |
| 130 | 130 | $resultQuery->bindParam("userId", $userId); |
| 131 | 131 | $resultQuery->execute(); |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | // Create the query we're going to run against the meta database |
| 63 | 63 | $wikiQuery = $this->client->createQueryBuilder(); |
| 64 | 64 | $wikiQuery |
| 65 | - ->select([ 'dbName', 'name', 'url' ]) |
|
| 65 | + ->select(['dbName', 'name', 'url']) |
|
| 66 | 66 | ->from('wiki') |
| 67 | 67 | ->where($wikiQuery->expr()->eq('dbname', ':project')) |
| 68 | 68 | // The meta database will have the project's URL stored as https://en.wikipedia.org |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | $this->dbName = $dbName; |
| 101 | 101 | $this->url = $url; |
| 102 | 102 | |
| 103 | - return [ 'dbName' => $dbName, 'wikiName' => $wikiName, 'url' => $url ]; |
|
| 103 | + return ['dbName' => $dbName, 'wikiName' => $wikiName, 'url' => $url]; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | /** |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | public function allProjects() |
| 110 | 110 | { |
| 111 | 111 | $wikiQuery = $this->client->createQueryBuilder(); |
| 112 | - $wikiQuery->select([ 'dbName', 'name', 'url' ])->from('wiki'); |
|
| 112 | + $wikiQuery->select(['dbName', 'name', 'url'])->from('wiki'); |
|
| 113 | 113 | $stmt = $wikiQuery->execute(); |
| 114 | 114 | $out = $stmt->fetchAll(); |
| 115 | 115 | return $out; |
@@ -16,38 +16,38 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | $options = ['is_safe' => ['html']]; |
| 18 | 18 | return [ |
| 19 | - new \Twig_SimpleFunction('request_time', [ $this, 'requestTime' ], $options), |
|
| 20 | - new \Twig_SimpleFunction('memory_usage', [ $this, 'requestMemory' ], $options), |
|
| 21 | - new \Twig_SimpleFunction('year', [ $this, 'generateYear' ], $options), |
|
| 22 | - new \Twig_SimpleFunction('linkWiki', [ $this, 'linkToWiki' ], $options), |
|
| 23 | - new \Twig_SimpleFunction('linkWikiScript', [ $this, 'linkToWikiScript' ], $options), |
|
| 24 | - new \Twig_SimpleFunction('msgPrintExists', [ $this, 'intuitionMessagePrintExists' ], $options), |
|
| 25 | - new \Twig_SimpleFunction('msgExists', [ $this, 'intuitionMessageExists' ], $options), |
|
| 26 | - new \Twig_SimpleFunction('msg', [ $this, 'intuitionMessage' ], $options), |
|
| 27 | - new \Twig_SimpleFunction('msg_footer', [ $this, 'intuitionMessageFooter' ], $options), |
|
| 28 | - new \Twig_SimpleFunction('lang', [ $this, 'getLang' ], $options), |
|
| 29 | - new \Twig_SimpleFunction('langName', [ $this, 'getLangName' ], $options), |
|
| 30 | - new \Twig_SimpleFunction('allLangs', [ $this, 'getAllLangs' ]), |
|
| 31 | - new \Twig_SimpleFunction('isRTL', [ $this, 'intuitionIsRTL' ]), |
|
| 32 | - new \Twig_SimpleFunction('shortHash', [ $this, 'gitShortHash' ]), |
|
| 33 | - new \Twig_SimpleFunction('hash', [ $this, 'gitHash' ]), |
|
| 34 | - new \Twig_SimpleFunction('enabled', [ $this, 'tabEnabled' ]), |
|
| 35 | - new \Twig_SimpleFunction('tools', [ $this, 'allTools' ]), |
|
| 36 | - new \Twig_SimpleFunction('color', [ $this, 'getColorList' ]), |
|
| 37 | - new \Twig_SimpleFunction('isWMFLabs', [ $this, 'isWMFLabs' ]), |
|
| 38 | - new \Twig_SimpleFunction('isSingleWiki', [ $this, 'isSingleWiki' ]), |
|
| 39 | - new \Twig_SimpleFunction('getReplagThreshold', [ $this, 'getReplagThreshold' ]), |
|
| 40 | - new \Twig_SimpleFunction('loadStylesheetsFromCDN', [ $this, 'loadStylesheetsFromCDN' ]), |
|
| 41 | - new \Twig_SimpleFunction('isWMFLabs', [ $this, 'isWMFLabs' ]), |
|
| 42 | - new \Twig_SimpleFunction('replag', [ $this, 'replag' ]), |
|
| 43 | - new \Twig_SimpleFunction('link', [ $this, 'link' ]), |
|
| 19 | + new \Twig_SimpleFunction('request_time', [$this, 'requestTime'], $options), |
|
| 20 | + new \Twig_SimpleFunction('memory_usage', [$this, 'requestMemory'], $options), |
|
| 21 | + new \Twig_SimpleFunction('year', [$this, 'generateYear'], $options), |
|
| 22 | + new \Twig_SimpleFunction('linkWiki', [$this, 'linkToWiki'], $options), |
|
| 23 | + new \Twig_SimpleFunction('linkWikiScript', [$this, 'linkToWikiScript'], $options), |
|
| 24 | + new \Twig_SimpleFunction('msgPrintExists', [$this, 'intuitionMessagePrintExists'], $options), |
|
| 25 | + new \Twig_SimpleFunction('msgExists', [$this, 'intuitionMessageExists'], $options), |
|
| 26 | + new \Twig_SimpleFunction('msg', [$this, 'intuitionMessage'], $options), |
|
| 27 | + new \Twig_SimpleFunction('msg_footer', [$this, 'intuitionMessageFooter'], $options), |
|
| 28 | + new \Twig_SimpleFunction('lang', [$this, 'getLang'], $options), |
|
| 29 | + new \Twig_SimpleFunction('langName', [$this, 'getLangName'], $options), |
|
| 30 | + new \Twig_SimpleFunction('allLangs', [$this, 'getAllLangs']), |
|
| 31 | + new \Twig_SimpleFunction('isRTL', [$this, 'intuitionIsRTL']), |
|
| 32 | + new \Twig_SimpleFunction('shortHash', [$this, 'gitShortHash']), |
|
| 33 | + new \Twig_SimpleFunction('hash', [$this, 'gitHash']), |
|
| 34 | + new \Twig_SimpleFunction('enabled', [$this, 'tabEnabled']), |
|
| 35 | + new \Twig_SimpleFunction('tools', [$this, 'allTools']), |
|
| 36 | + new \Twig_SimpleFunction('color', [$this, 'getColorList']), |
|
| 37 | + new \Twig_SimpleFunction('isWMFLabs', [$this, 'isWMFLabs']), |
|
| 38 | + new \Twig_SimpleFunction('isSingleWiki', [$this, 'isSingleWiki']), |
|
| 39 | + new \Twig_SimpleFunction('getReplagThreshold', [$this, 'getReplagThreshold']), |
|
| 40 | + new \Twig_SimpleFunction('loadStylesheetsFromCDN', [$this, 'loadStylesheetsFromCDN']), |
|
| 41 | + new \Twig_SimpleFunction('isWMFLabs', [$this, 'isWMFLabs']), |
|
| 42 | + new \Twig_SimpleFunction('replag', [$this, 'replag']), |
|
| 43 | + new \Twig_SimpleFunction('link', [$this, 'link']), |
|
| 44 | 44 | ]; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function requestTime($decimals = 3) |
| 48 | 48 | { |
| 49 | 49 | |
| 50 | - return number_format(microtime(true) - $_SERVER['REQUEST_TIME_FLOAT'], $decimals); |
|
| 50 | + return number_format(microtime(true)-$_SERVER['REQUEST_TIME_FLOAT'], $decimals); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | public function requestMemory() |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | public function linkToWiki($url, $page, $secondary = "") |
| 75 | 75 | { |
| 76 | - $link = $url . "/"; |
|
| 76 | + $link = $url."/"; |
|
| 77 | 77 | |
| 78 | 78 | if ($this->isWMFLabs()) { |
| 79 | 79 | $link .= "wiki/"; |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | |
| 91 | 91 | public function linkToWikiScript($url, $secondary) |
| 92 | 92 | { |
| 93 | - $link = $url . "/"; |
|
| 93 | + $link = $url."/"; |
|
| 94 | 94 | |
| 95 | 95 | if ($this->isWMFLabs()) { |
| 96 | 96 | $link .= "w/"; |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | // TODO: refactor all intuition stuff so it can be used anywhere |
| 107 | 107 | public function intuitionMessageExists($message = "") |
| 108 | 108 | { |
| 109 | - return $this->getIntuition()->msgExists($message, [ "domain" => "xtools" ]); |
|
| 109 | + return $this->getIntuition()->msgExists($message, ["domain" => "xtools"]); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | public function intuitionMessagePrintExists($message = "", $vars = []) |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | public function intuitionMessage($message = "", $vars = []) |
| 127 | 127 | { |
| 128 | - return $this->getIntuition()->msg($message, [ "domain" => "xtools", "variables" => $vars ]); |
|
| 128 | + return $this->getIntuition()->msg($message, ["domain" => "xtools", "variables" => $vars]); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | public function intuitionMessageFooter() |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public function getAllLangs() |
| 155 | 155 | { |
| 156 | - $messageFiles = glob($this->container->getParameter("kernel.root_dir") . '/../i18n/*.json'); |
|
| 156 | + $messageFiles = glob($this->container->getParameter("kernel.root_dir").'/../i18n/*.json'); |
|
| 157 | 157 | |
| 158 | 158 | $languages = array_values(array_unique(array_map( |
| 159 | - function ($filename) { |
|
| 159 | + function($filename) { |
|
| 160 | 160 | return basename($filename, '.json'); |
| 161 | 161 | }, |
| 162 | 162 | $messageFiles |
@@ -208,41 +208,41 @@ discard block |
||
| 208 | 208 | public static function getColorList($num = false) |
| 209 | 209 | { |
| 210 | 210 | $colors = [ |
| 211 | - 0 => '#Cc0000',# '#FF005A', #red '#FF5555', |
|
| 211 | + 0 => '#Cc0000', # '#FF005A', #red '#FF5555', |
|
| 212 | 212 | 1 => '#F7b7b7', |
| 213 | - 2 => '#5c8d20',# '#008800', #green'#55FF55', |
|
| 213 | + 2 => '#5c8d20', # '#008800', #green'#55FF55', |
|
| 214 | 214 | 3 => '#85eD82', |
| 215 | 215 | 4 => '#2E97E0', # blue |
| 216 | 216 | 5 => '#B9E3F9', |
| 217 | - 6 => '#e1711d', # orange |
|
| 217 | + 6 => '#e1711d', # orange |
|
| 218 | 218 | 7 => '#ffc04c', |
| 219 | 219 | 8 => '#FDFF98', # yellow |
| 220 | 220 | 9 => '#5555FF', |
| 221 | 221 | 10 => '#55FFFF', |
| 222 | - 11 => '#0000C0', # |
|
| 223 | - 12 => '#008800', # green |
|
| 222 | + 11 => '#0000C0', # |
|
| 223 | + 12 => '#008800', # green |
|
| 224 | 224 | 13 => '#00C0C0', |
| 225 | - 14 => '#FFAFAF', # rosé |
|
| 226 | - 15 => '#808080', # gray |
|
| 225 | + 14 => '#FFAFAF', # rosé |
|
| 226 | + 15 => '#808080', # gray |
|
| 227 | 227 | 16 => '#00C000', |
| 228 | 228 | 17 => '#404040', |
| 229 | - 18 => '#C0C000', # green |
|
| 229 | + 18 => '#C0C000', # green |
|
| 230 | 230 | 19 => '#C000C0', |
| 231 | - 100 => '#75A3D1', # blue |
|
| 232 | - 101 => '#A679D2', # purple |
|
| 231 | + 100 => '#75A3D1', # blue |
|
| 232 | + 101 => '#A679D2', # purple |
|
| 233 | 233 | 102 => '#660000', |
| 234 | 234 | 103 => '#000066', |
| 235 | - 104 => '#FAFFAF', # caramel |
|
| 235 | + 104 => '#FAFFAF', # caramel |
|
| 236 | 236 | 105 => '#408345', |
| 237 | 237 | 106 => '#5c8d20', |
| 238 | - 107 => '#e1711d', # red |
|
| 239 | - 108 => '#94ef2b', # light green |
|
| 240 | - 109 => '#756a4a', # brown |
|
| 238 | + 107 => '#e1711d', # red |
|
| 239 | + 108 => '#94ef2b', # light green |
|
| 240 | + 109 => '#756a4a', # brown |
|
| 241 | 241 | 110 => '#6f1dab', |
| 242 | 242 | 111 => '#301e30', |
| 243 | 243 | 112 => '#5c9d96', |
| 244 | - 113 => '#a8cd8c', # earth green |
|
| 245 | - 114 => '#f2b3f1', # light purple |
|
| 244 | + 113 => '#a8cd8c', # earth green |
|
| 245 | + 114 => '#f2b3f1', # light purple |
|
| 246 | 246 | 115 => '#9b5828', |
| 247 | 247 | 118 => '#99FFFF', |
| 248 | 248 | 119 => '#99BBFF', |
@@ -263,8 +263,8 @@ discard block |
||
| 263 | 263 | 446 => '#06DCFB', |
| 264 | 264 | 447 => '#892EE4', |
| 265 | 265 | 460 => '#99FF66', |
| 266 | - 461 => '#99CC66', # green |
|
| 267 | - 470 => '#CCCC33', # ocker |
|
| 266 | + 461 => '#99CC66', # green |
|
| 267 | + 470 => '#CCCC33', # ocker |
|
| 268 | 268 | 471 => '#CCFF33', |
| 269 | 269 | 480 => '#6699FF', |
| 270 | 270 | 481 => '#66FFFF', |
@@ -279,18 +279,18 @@ discard block |
||
| 279 | 279 | 1198 => '#FF34B3', |
| 280 | 280 | 1199 => '#8B1C62', |
| 281 | 281 | |
| 282 | - '#61a9f3',# blue |
|
| 283 | - '#f381b9',# pink |
|
| 282 | + '#61a9f3', # blue |
|
| 283 | + '#f381b9', # pink |
|
| 284 | 284 | '#61E3A9', |
| 285 | 285 | '#D56DE2', |
| 286 | 286 | '#85eD82', |
| 287 | 287 | '#F7b7b7', |
| 288 | 288 | '#CFDF49', |
| 289 | 289 | '#88d8f2', |
| 290 | - '#07AF7B',# green |
|
| 290 | + '#07AF7B', # green |
|
| 291 | 291 | '#B9E3F9', |
| 292 | 292 | '#FFF3AD', |
| 293 | - '#EF606A',# red |
|
| 293 | + '#EF606A', # red |
|
| 294 | 294 | '#EC8833', |
| 295 | 295 | '#FFF100', |
| 296 | 296 | '#87C9A5', |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | public function getFilters() |
| 408 | 408 | { |
| 409 | 409 | return [ |
| 410 | - new \Twig_SimpleFilter('capitalize_first', [ $this, 'capitalizeFirst' ]), |
|
| 410 | + new \Twig_SimpleFilter('capitalize_first', [$this, 'capitalizeFirst']), |
|
| 411 | 411 | ]; |
| 412 | 412 | } |
| 413 | 413 | |