@@ -132,10 +132,10 @@ discard block |
||
| 132 | 132 | ])->fetchAll(); |
| 133 | 133 | |
| 134 | 134 | $logCounts = array_combine( |
| 135 | - array_map(function ($e) { |
|
| 135 | + array_map(function($e) { |
|
| 136 | 136 | return $e['source']; |
| 137 | 137 | }, $results), |
| 138 | - array_map(function ($e) { |
|
| 138 | + array_map(function($e) { |
|
| 139 | 139 | return $e['value']; |
| 140 | 140 | }, $results) |
| 141 | 141 | ); |
@@ -346,9 +346,9 @@ discard block |
||
| 346 | 346 | $params = $user->isAnon() ? ['username' => $user->getUsername()] : ['userId' => $user->getId($project)]; |
| 347 | 347 | $results = $this->executeProjectsQuery($sql, $params)->fetchAll(); |
| 348 | 348 | |
| 349 | - $namespaceTotals = array_combine(array_map(function ($e) { |
|
| 349 | + $namespaceTotals = array_combine(array_map(function($e) { |
|
| 350 | 350 | return $e['page_namespace']; |
| 351 | - }, $results), array_map(function ($e) { |
|
| 351 | + }, $results), array_map(function($e) { |
|
| 352 | 352 | return $e['total']; |
| 353 | 353 | }, $results)); |
| 354 | 354 | |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | ORDER BY revs.rev_timestamp DESC"; |
| 401 | 401 | $queries[] = $sql; |
| 402 | 402 | } |
| 403 | - $sql = "SELECT * FROM ((\n" . join("\n) UNION (\n", $queries) . ")) a ORDER BY timestamp DESC LIMIT $limit"; |
|
| 403 | + $sql = "SELECT * FROM ((\n".join("\n) UNION (\n", $queries).")) a ORDER BY timestamp DESC LIMIT $limit"; |
|
| 404 | 404 | |
| 405 | 405 | if (is_numeric($offset)) { |
| 406 | 406 | $sql .= " OFFSET $offset"; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | // Filter out unblocks unless requested. |
| 133 | 133 | if ($blocksOnly) { |
| 134 | - $blocks = array_filter($blocks, function ($block) { |
|
| 134 | + $blocks = array_filter($blocks, function($block) { |
|
| 135 | 135 | return $block['log_action'] === 'block'; |
| 136 | 136 | }); |
| 137 | 137 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | */ |
| 166 | 166 | public function countAllRevisions() |
| 167 | 167 | { |
| 168 | - return $this->countLiveRevisions() + $this->countDeletedRevisions(); |
|
| 168 | + return $this->countLiveRevisions()+$this->countDeletedRevisions(); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | public function countRevisionsWithoutComments() |
| 186 | 186 | { |
| 187 | - return $this->countLiveRevisions() - $this->countRevisionsWithComments(); |
|
| 187 | + return $this->countLiveRevisions()-$this->countRevisionsWithComments(); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | public function countAllPagesEdited() |
| 225 | 225 | { |
| 226 | - return $this->countLivePagesEdited() + $this->countDeletedPagesEdited(); |
|
| 226 | + return $this->countLivePagesEdited()+$this->countDeletedPagesEdited(); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /** |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | */ |
| 234 | 234 | public function countPagesCreated() |
| 235 | 235 | { |
| 236 | - return $this->countCreatedPagesLive() + $this->countPagesCreatedDeleted(); |
|
| 236 | + return $this->countCreatedPagesLive()+$this->countPagesCreatedDeleted(); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | /** |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | } elseif ($block['log_action'] === 'unblock') { |
| 374 | 374 | // The last block was lifted. So the duration will be the time from when the |
| 375 | 375 | // last block was set to the time of the unblock. |
| 376 | - $timeSinceLastBlock = $timestamp - $lastBlock[0]; |
|
| 376 | + $timeSinceLastBlock = $timestamp-$lastBlock[0]; |
|
| 377 | 377 | if ($timeSinceLastBlock > $this->longestBlockSeconds) { |
| 378 | 378 | $this->longestBlockSeconds = $timeSinceLastBlock; |
| 379 | 379 | |
@@ -384,8 +384,8 @@ discard block |
||
| 384 | 384 | // The last block was modified. So we will adjust $lastBlock to include |
| 385 | 385 | // the difference of the duration of the new reblock, and time since the last block. |
| 386 | 386 | // $lastBlock is left unchanged if its duration was indefinite. |
| 387 | - $timeSinceLastBlock = $timestamp - $lastBlock[0]; |
|
| 388 | - $lastBlock[1] = $timeSinceLastBlock + $duration; |
|
| 387 | + $timeSinceLastBlock = $timestamp-$lastBlock[0]; |
|
| 388 | + $lastBlock[1] = $timeSinceLastBlock+$duration; |
|
| 389 | 389 | } |
| 390 | 390 | } |
| 391 | 391 | |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | // Test if the last block is still active, and if so use the expiry as the duration. |
| 398 | - $lastBlockExpiry = $lastBlock[0] + $lastBlock[1]; |
|
| 398 | + $lastBlockExpiry = $lastBlock[0]+$lastBlock[1]; |
|
| 399 | 399 | if ($lastBlockExpiry > time() && $lastBlockExpiry > $this->longestBlockSeconds) { |
| 400 | 400 | $this->longestBlockSeconds = $lastBlock[1]; |
| 401 | 401 | // Otherwise, test if the duration of the last block is now the longest overall. |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | // If invalid, $duration is left as null. |
| 437 | 437 | if (strtotime($durationStr)) { |
| 438 | 438 | $expiry = strtotime($durationStr, $timestamp); |
| 439 | - $duration = $expiry - $timestamp; |
|
| 439 | + $duration = $expiry-$timestamp; |
|
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | return [$timestamp, $duration]; |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | $import = isset($logCounts['import-import']) ? (int)$logCounts['import-import'] : 0; |
| 514 | 514 | $interwiki = isset($logCounts['import-interwiki']) ? (int)$logCounts['import-interwiki'] : 0; |
| 515 | 515 | $upload = isset($logCounts['import-upload']) ? (int)$logCounts['import-upload'] : 0; |
| 516 | - return $import + $interwiki + $upload; |
|
| 516 | + return $import+$interwiki+$upload; |
|
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | /** |
@@ -640,9 +640,9 @@ discard block |
||
| 640 | 640 | public function approvals() |
| 641 | 641 | { |
| 642 | 642 | $logCounts = $this->getLogCounts(); |
| 643 | - $total = $logCounts['review-approve'] + |
|
| 644 | - (!empty($logCounts['review-approve-a']) ? $logCounts['review-approve-a'] : 0) + |
|
| 645 | - (!empty($logCounts['review-approve-i']) ? $logCounts['review-approve-i'] : 0) + |
|
| 643 | + $total = $logCounts['review-approve']+ |
|
| 644 | + (!empty($logCounts['review-approve-a']) ? $logCounts['review-approve-a'] : 0)+ |
|
| 645 | + (!empty($logCounts['review-approve-i']) ? $logCounts['review-approve-i'] : 0)+ |
|
| 646 | 646 | (!empty($logCounts['review-approve-ia']) ? $logCounts['review-approve-ia'] : 0); |
| 647 | 647 | return $total; |
| 648 | 648 | } |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | $logCounts = $this->getLogCounts(); |
| 667 | 667 | $create2 = $logCounts['newusers-create2'] ?: 0; |
| 668 | 668 | $byemail = $logCounts['newusers-byemail'] ?: 0; |
| 669 | - return $create2 + $byemail; |
|
| 669 | + return $create2+$byemail; |
|
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | /** |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | |
| 750 | 750 | $totals = $this->getRepository()->getMonthCounts($this->project, $this->user); |
| 751 | 751 | $out = [ |
| 752 | - 'yearLabels' => [], // labels for years |
|
| 752 | + 'yearLabels' => [], // labels for years |
|
| 753 | 753 | 'monthLabels' => [], // labels for months |
| 754 | 754 | 'totals' => [], // actual totals, grouped by namespace, year and then month |
| 755 | 755 | ]; |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | $out['totals'][$ns][$total['year']] = []; |
| 817 | 817 | } |
| 818 | 818 | |
| 819 | - $out['totals'][$ns][$total['year']][$total['month']] = (int) $total['count']; |
|
| 819 | + $out['totals'][$ns][$total['year']][$total['month']] = (int)$total['count']; |
|
| 820 | 820 | } |
| 821 | 821 | |
| 822 | 822 | return [$out, $firstEdit]; |
@@ -833,9 +833,9 @@ discard block |
||
| 833 | 833 | private function fillInMonthTotalsAndLabels($out, DatePeriod $dateRange) |
| 834 | 834 | { |
| 835 | 835 | foreach ($dateRange as $monthObj) { |
| 836 | - $year = (int) $monthObj->format('Y'); |
|
| 836 | + $year = (int)$monthObj->format('Y'); |
|
| 837 | 837 | $yearLabel = $this->i18n->dateFormat($monthObj, 'yyyy'); |
| 838 | - $month = (int) $monthObj->format('n'); |
|
| 838 | + $month = (int)$monthObj->format('n'); |
|
| 839 | 839 | $monthLabel = $this->i18n->dateFormat($monthObj, 'yyyy-MM'); |
| 840 | 840 | |
| 841 | 841 | // Fill in labels |
@@ -984,8 +984,8 @@ discard block |
||
| 984 | 984 | |
| 985 | 985 | if ($sorted) { |
| 986 | 986 | // Sort. |
| 987 | - uasort($this->globalEditCounts, function ($a, $b) { |
|
| 988 | - return $b['total'] - $a['total']; |
|
| 987 | + uasort($this->globalEditCounts, function($a, $b) { |
|
| 988 | + return $b['total']-$a['total']; |
|
| 989 | 989 | }); |
| 990 | 990 | } |
| 991 | 991 | |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | public function countSmallEdits() |
| 1074 | 1074 | { |
| 1075 | 1075 | $editSizeData = $this->getEditSizeData(); |
| 1076 | - return isset($editSizeData['small_edits']) ? (int) $editSizeData['small_edits'] : 0; |
|
| 1076 | + return isset($editSizeData['small_edits']) ? (int)$editSizeData['small_edits'] : 0; |
|
| 1077 | 1077 | } |
| 1078 | 1078 | |
| 1079 | 1079 | /** |
@@ -1083,7 +1083,7 @@ discard block |
||
| 1083 | 1083 | public function countLargeEdits() |
| 1084 | 1084 | { |
| 1085 | 1085 | $editSizeData = $this->getEditSizeData(); |
| 1086 | - return isset($editSizeData['large_edits']) ? (int) $editSizeData['large_edits'] : 0; |
|
| 1086 | + return isset($editSizeData['large_edits']) ? (int)$editSizeData['large_edits'] : 0; |
|
| 1087 | 1087 | } |
| 1088 | 1088 | |
| 1089 | 1089 | /** |