@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | |
| 113 | 113 | // Construct the page name |
| 114 | 114 | if (!isset($this->getParameter('rfx')[$domain]['pages'][$type])) { |
| 115 | - $pageTitle= ''; |
|
| 115 | + $pageTitle = ''; |
|
| 116 | 116 | } else { |
| 117 | - $pageTitle= $this->getParameter('rfx')[$domain]['pages'][$type]; |
|
| 117 | + $pageTitle = $this->getParameter('rfx')[$domain]['pages'][$type]; |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - $pageTitle.= '/'.$this->user->getUsername(); |
|
| 120 | + $pageTitle .= '/'.$this->user->getUsername(); |
|
| 121 | 121 | $page = new Page($this->project, $pageTitle); |
| 122 | 122 | $pageRepo = new PageRepository(); |
| 123 | 123 | $pageRepo->setContainer($this->container); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | $neutral = $rfx->getSection('neutral'); |
| 146 | 146 | $dup = $rfx->getDuplicates(); |
| 147 | 147 | |
| 148 | - $total = count($support) + count($oppose) + count($neutral); |
|
| 148 | + $total = count($support)+count($oppose)+count($neutral); |
|
| 149 | 149 | |
| 150 | 150 | if (0 === $total) { |
| 151 | 151 | $this->addFlashMessage('notice', 'no-result', [$pageTitle]); |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | 'total_editcount' => $this->autoEdits->getEditCount(), |
| 245 | 245 | 'automated_editcount' => $this->autoEdits->getAutomatedCount(), |
| 246 | 246 | ]; |
| 247 | - $ret['nonautomated_editcount'] = $ret['total_editcount'] - $ret['automated_editcount']; |
|
| 247 | + $ret['nonautomated_editcount'] = $ret['total_editcount']-$ret['automated_editcount']; |
|
| 248 | 248 | |
| 249 | 249 | if ('' != $tools) { |
| 250 | 250 | $tools = $this->autoEdits->getToolCounts(); |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | |
| 277 | 277 | $this->setupAutoEdits(); |
| 278 | 278 | |
| 279 | - $ret = array_map(function ($rev) { |
|
| 279 | + $ret = array_map(function($rev) { |
|
| 280 | 280 | return array_merge([ |
| 281 | 281 | 'full_page_title' => $this->getPageFromNsAndTitle( |
| 282 | 282 | (int)$rev['page_namespace'], |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | $ret['tool'] = $this->autoEdits->getTool(); |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | - $ret['automated_edits'] = array_map(function ($rev) { |
|
| 320 | + $ret['automated_edits'] = array_map(function($rev) { |
|
| 321 | 321 | return array_merge([ |
| 322 | 322 | 'full_page_title' => $this->getPageFromNsAndTitle( |
| 323 | 323 | (int)$rev['page_namespace'], |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | * This file contains only the HelperBase class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Helper; |
| 9 | 9 | |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the I18nHelper. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Helper; |
| 9 | 9 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // Find the path, and complain if English doesn't exist. |
| 77 | - $path = $this->container->getParameter('kernel.root_dir') . '/../i18n'; |
|
| 77 | + $path = $this->container->getParameter('kernel.root_dir').'/../i18n'; |
|
| 78 | 78 | if (!file_exists("$path/en.json")) { |
| 79 | 79 | throw new Exception("Language directory doesn't exist: $path"); |
| 80 | 80 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $messageFiles = glob($this->container->getParameter('kernel.root_dir').'/../i18n/*.json'); |
| 130 | 130 | |
| 131 | 131 | $languages = array_values(array_unique(array_map( |
| 132 | - function ($filename) { |
|
| 132 | + function($filename) { |
|
| 133 | 133 | return basename($filename, '.json'); |
| 134 | 134 | }, |
| 135 | 135 | $messageFiles |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | $this->getIntuition()->getLangFallbacks($this->getLang()) |
| 172 | 172 | ); |
| 173 | 173 | |
| 174 | - return array_filter($fallbacks, function ($lang) use ($i18nPath) { |
|
| 174 | + return array_filter($fallbacks, function($lang) use ($i18nPath) { |
|
| 175 | 175 | return is_file($i18nPath.$lang.'.json'); |
| 176 | 176 | }); |
| 177 | 177 | } |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the ArticleInfoRepository class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Repository; |
| 9 | 9 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $datesConditions = $this->getDateConditions($start, $end); |
| 35 | 35 | |
| 36 | 36 | $sql = "SELECT COUNT(DISTINCT(rev_id)) AS count, rev_user_text AS username, ug_group AS current |
| 37 | - FROM " . $project->getTableName('revision') . " |
|
| 37 | + FROM " . $project->getTableName('revision')." |
|
| 38 | 38 | LEFT JOIN $userGroupsTable ON rev_user = ug_user |
| 39 | 39 | LEFT JOIN $userFormerGroupsTable ON rev_user = ufg_user |
| 40 | 40 | WHERE rev_page = :pageId AND (ug_group = 'bot' OR ufg_group = 'bot') $datesConditions |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | $sql = "SELECT log_action, log_type, log_timestamp AS 'timestamp' |
| 60 | 60 | FROM $loggingTable |
| 61 | - WHERE log_namespace = '" . $page->getNamespace() . "' |
|
| 61 | + WHERE log_namespace = '".$page->getNamespace()."' |
|
| 62 | 62 | AND log_title = :title AND log_timestamp > 1 $datesConditions |
| 63 | 63 | AND log_type IN ('delete', 'move', 'protect', 'stable')"; |
| 64 | 64 | $title = str_replace(' ', '_', $page->getTitle()); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | $projectLang = $page->getProject()->getLang(); |
| 81 | 81 | |
| 82 | - $url = "https://api.wikiwho.net/$projectLang/api/v1.0.0-beta/rev_content/" . |
|
| 82 | + $url = "https://api.wikiwho.net/$projectLang/api/v1.0.0-beta/rev_content/". |
|
| 83 | 83 | "$title/?o_rev_id=false&editor=true&token_id=false&out=false&in=false"; |
| 84 | 84 | |
| 85 | 85 | $res = $client->request('GET', $url, ['http_errors' => false]); |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the TopEditsRepository class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Repository; |
| 9 | 9 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $hasPageAssessments = $this->isLabs() && $project->hasPageAssessments() && 0 === $namespace; |
| 59 | 59 | $paTable = $this->getTableName($project->getDatabaseName(), 'page_assessments'); |
| 60 | 60 | $paSelect = $hasPageAssessments |
| 61 | - ? ", ( |
|
| 61 | + ? ", ( |
|
| 62 | 62 | SELECT pa_class |
| 63 | 63 | FROM $paTable |
| 64 | 64 | WHERE pa_page_id = page_id |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | $hasPageAssessments = $this->isLabs() && $project->hasPageAssessments(); |
| 140 | 140 | $pageAssessmentsTable = $this->getTableName($project->getDatabaseName(), 'page_assessments'); |
| 141 | 141 | $paSelect = $hasPageAssessments |
| 142 | - ? ", ( |
|
| 142 | + ? ", ( |
|
| 143 | 143 | SELECT pa_class |
| 144 | 144 | FROM $pageAssessmentsTable |
| 145 | 145 | WHERE pa_page_id = e.page_id |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | * This file contains only the PageRepository class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Repository; |
| 9 | 9 | |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | // supply as the OFFSET. |
| 153 | 153 | $limitClause = ''; |
| 154 | 154 | if (intval($limit) > 0 && isset($numRevisions)) { |
| 155 | - $offset = $numRevisions - $limit; |
|
| 155 | + $offset = $numRevisions-$limit; |
|
| 156 | 156 | $limitClause = "LIMIT $offset, $limit"; |
| 157 | 157 | } |
| 158 | 158 | |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | $time2 = time(); |
| 294 | 294 | |
| 295 | 295 | // If it took over 5 seconds, cache the result for 20 minutes. |
| 296 | - if ($time2 - $time1 > 5) { |
|
| 296 | + if ($time2-$time1 > 5) { |
|
| 297 | 297 | $this->setCache($cacheKey, $result, 'PT20M'); |
| 298 | 298 | } |
| 299 | 299 | |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | |
| 382 | 382 | $wikidataId = ltrim($page->getWikidataId(), 'Q'); |
| 383 | 383 | |
| 384 | - $sql = "SELECT " . ($count ? 'COUNT(*) AS count' : '*') . " |
|
| 384 | + $sql = "SELECT ".($count ? 'COUNT(*) AS count' : '*')." |
|
| 385 | 385 | FROM wikidatawiki_p.wb_items_per_site |
| 386 | 386 | WHERE ips_item_id = :wikidataId"; |
| 387 | 387 | |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | 'wikidataId' => $wikidataId, |
| 390 | 390 | ])->fetchAll(); |
| 391 | 391 | |
| 392 | - return $count ? (int) $result[0]['count'] : $result; |
|
| 392 | + return $count ? (int)$result[0]['count'] : $result; |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | /** |
@@ -427,7 +427,7 @@ discard block |
||
| 427 | 427 | |
| 428 | 428 | // Transform to associative array by 'type' |
| 429 | 429 | foreach ($res as $row) { |
| 430 | - $data[$row['type'] . '_count'] = (int)$row['value']; |
|
| 430 | + $data[$row['type'].'_count'] = (int)$row['value']; |
|
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | return $data; |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | |
| 470 | 470 | $project = $page->getProject()->getDomain(); |
| 471 | 471 | |
| 472 | - $url = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/' . |
|
| 472 | + $url = 'https://wikimedia.org/api/rest_v1/metrics/pageviews/per-article/'. |
|
| 473 | 473 | "$project/all-access/user/$title/daily/$start/$end"; |
| 474 | 474 | |
| 475 | 475 | $res = $client->request('GET', $url); |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | $normalized = []; |
| 542 | 542 | if (isset($result['query']['normalized'])) { |
| 543 | 543 | array_map( |
| 544 | - function ($e) use (&$normalized): void { |
|
| 544 | + function($e) use (&$normalized): void { |
|
| 545 | 545 | $normalized[$e['to']] = $e['from']; |
| 546 | 546 | }, |
| 547 | 547 | $result['query']['normalized'] |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | * This file contains only the PageAssessmentsRepository class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Repository; |
| 9 | 9 | |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | * This file contains only the AdminStatsRepository class. |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | -declare(strict_types = 1); |
|
| 6 | +declare(strict_types=1); |
|
| 7 | 7 | |
| 8 | 8 | namespace AppBundle\Repository; |
| 9 | 9 | |