@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | $userGroupsTable = $project->getTableName('user_groups'); |
| 23 | 23 | $userFromerGroupsTable = $project->getTableName('user_former_groups'); |
| 24 | 24 | $sql = "SELECT COUNT(rev_user_text) AS count, rev_user_text AS username, ug_group AS current |
| 25 | - FROM " . $project->getTableName('revision') . " |
|
| 25 | + FROM " . $project->getTableName('revision')." |
|
| 26 | 26 | LEFT JOIN $userGroupsTable ON rev_user = ug_user |
| 27 | 27 | LEFT JOIN $userFromerGroupsTable ON rev_user = ufg_user |
| 28 | 28 | WHERE rev_page = :pageId AND (ug_group = 'bot' OR ufg_group = 'bot') |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $loggingTable = $page->getProject()->getTableName('logging', 'logindex'); |
| 45 | 45 | $sql = "SELECT log_action, log_type, log_timestamp AS 'timestamp' |
| 46 | 46 | FROM $loggingTable |
| 47 | - WHERE log_namespace = '" . $page->getNamespace() . "' |
|
| 47 | + WHERE log_namespace = '".$page->getNamespace()."' |
|
| 48 | 48 | AND log_title = :title AND log_timestamp > 1 |
| 49 | 49 | AND log_type IN ('delete', 'move', 'protect', 'stable')"; |
| 50 | 50 | $title = str_replace(' ', '_', $page->getTitle()); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | public function getMaxRevisions() |
| 161 | 161 | { |
| 162 | 162 | if (!isset($this->maxRevisions)) { |
| 163 | - $this->maxRevisions = (int) $this->container->getParameter('app.max_page_revisions'); |
|
| 163 | + $this->maxRevisions = (int)$this->container->getParameter('app.max_page_revisions'); |
|
| 164 | 164 | } |
| 165 | 165 | return $this->maxRevisions; |
| 166 | 166 | } |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | $this->yearMonthCounts[$editYear]['all']++; |
| 807 | 807 | $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']++; |
| 808 | 808 | // This will ultimately be the size of the page by the end of the year |
| 809 | - $this->yearMonthCounts[$editYear]['size'] = (int) $edit->getLength(); |
|
| 809 | + $this->yearMonthCounts[$editYear]['size'] = (int)$edit->getLength(); |
|
| 810 | 810 | |
| 811 | 811 | // Keep track of which month had the most edits |
| 812 | 812 | $editsThisMonth = $this->yearMonthCounts[$editYear]['months'][$editMonth]['all']; |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | $editYear = $edit->getYear(); |
| 826 | 826 | |
| 827 | 827 | // Beginning of the month at 00:00:00. |
| 828 | - $firstEditTime = mktime(0, 0, 0, (int) $this->firstEdit->getMonth(), 1, $this->firstEdit->getYear()); |
|
| 828 | + $firstEditTime = mktime(0, 0, 0, (int)$this->firstEdit->getMonth(), 1, $this->firstEdit->getYear()); |
|
| 829 | 829 | |
| 830 | 830 | $this->yearMonthCounts[$editYear] = [ |
| 831 | 831 | 'all' => 0, |
@@ -954,14 +954,14 @@ discard block |
||
| 954 | 954 | $botData = $this->getRepository()->getBotData($this->page); |
| 955 | 955 | while ($bot = $botData->fetch()) { |
| 956 | 956 | $bots[$bot['username']] = [ |
| 957 | - 'count' => (int) $bot['count'], |
|
| 957 | + 'count' => (int)$bot['count'], |
|
| 958 | 958 | 'current' => $bot['current'] === 'bot', |
| 959 | 959 | ]; |
| 960 | 960 | } |
| 961 | 961 | |
| 962 | 962 | // Sort by edit count. |
| 963 | - uasort($bots, function ($a, $b) { |
|
| 964 | - return $b['count'] - $a['count']; |
|
| 963 | + uasort($bots, function($a, $b) { |
|
| 964 | + return $b['count']-$a['count']; |
|
| 965 | 965 | }); |
| 966 | 966 | |
| 967 | 967 | $this->bots = $bots; |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | |
| 1074 | 1074 | if ($info['all'] > 1) { |
| 1075 | 1075 | // Number of seconds/days between first and last edit |
| 1076 | - $secs = $info['last']->getTimestamp() - $info['first']->getTimestamp(); |
|
| 1076 | + $secs = $info['last']->getTimestamp()-$info['first']->getTimestamp(); |
|
| 1077 | 1077 | $days = $secs / (60 * 60 * 24); |
| 1078 | 1078 | |
| 1079 | 1079 | // Average time between edits (in days) |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | |
| 1093 | 1093 | // First sort editors array by the amount of text they added |
| 1094 | 1094 | $topTenEditorsByAdded = $this->editors; |
| 1095 | - uasort($topTenEditorsByAdded, function ($a, $b) { |
|
| 1095 | + uasort($topTenEditorsByAdded, function($a, $b) { |
|
| 1096 | 1096 | if ($a['added'] === $b['added']) { |
| 1097 | 1097 | return 0; |
| 1098 | 1098 | } |
@@ -1101,7 +1101,7 @@ discard block |
||
| 1101 | 1101 | |
| 1102 | 1102 | // Then build a new array of top 10 editors by added text, |
| 1103 | 1103 | // in the data structure needed for the chart |
| 1104 | - $this->topTenEditorsByAdded = array_map(function ($editor) { |
|
| 1104 | + $this->topTenEditorsByAdded = array_map(function($editor) { |
|
| 1105 | 1105 | $added = $this->editors[$editor]['added']; |
| 1106 | 1106 | return [ |
| 1107 | 1107 | 'label' => $editor, |