Passed
Pull Request — master (#115)
by MusikAnimal
04:04
created
src/Xtools/ArticleInfoRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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());
Please login to merge, or discard this patch.
src/Xtools/ArticleInfo.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -503,7 +503,7 @@
 block discarded – undo
503 503
     /**
504 504
      * Get a list of (semi-)automated tools that were used to edit the page, including
505 505
      * the number of times they were used, and a link to the tool's homepage.
506
-     * @return mixed[]
506
+     * @return string[]
507 507
      * @codeCoverageIgnore
508 508
      */
509 509
     public function getTools()
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
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
     }
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
         $editYear = $edit->getYear();
788 788
 
789 789
         // Beginning of the month at 00:00:00.
790
-        $firstEditTime = mktime(0, 0, 0, (int) $this->firstEdit->getMonth(), 1, $this->firstEdit->getYear());
790
+        $firstEditTime = mktime(0, 0, 0, (int)$this->firstEdit->getMonth(), 1, $this->firstEdit->getYear());
791 791
 
792 792
         $this->yearMonthCounts[$editYear] = [
793 793
             'all' => 0,
@@ -916,14 +916,14 @@  discard block
 block discarded – undo
916 916
         $botData = $this->getRepository()->getBotData($this->page);
917 917
         while ($bot = $botData->fetch()) {
918 918
             $bots[$bot['username']] = [
919
-                'count' => (int) $bot['count'],
919
+                'count' => (int)$bot['count'],
920 920
                 'current' => $bot['current'] === 'bot',
921 921
             ];
922 922
         }
923 923
 
924 924
         // Sort by edit count.
925
-        uasort($bots, function ($a, $b) {
926
-            return $b['count'] - $a['count'];
925
+        uasort($bots, function($a, $b) {
926
+            return $b['count']-$a['count'];
927 927
         });
928 928
 
929 929
         $this->bots = $bots;
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
 
1036 1036
             if ($info['all'] > 1) {
1037 1037
                 // Number of seconds/days between first and last edit
1038
-                $secs = $info['last']->getTimestamp() - $info['first']->getTimestamp();
1038
+                $secs = $info['last']->getTimestamp()-$info['first']->getTimestamp();
1039 1039
                 $days = $secs / (60 * 60 * 24);
1040 1040
 
1041 1041
                 // Average time between edits (in days)
@@ -1054,7 +1054,7 @@  discard block
 block discarded – undo
1054 1054
 
1055 1055
         // First sort editors array by the amount of text they added
1056 1056
         $topTenEditorsByAdded = $this->editors;
1057
-        uasort($topTenEditorsByAdded, function ($a, $b) {
1057
+        uasort($topTenEditorsByAdded, function($a, $b) {
1058 1058
             if ($a['added'] === $b['added']) {
1059 1059
                 return 0;
1060 1060
             }
@@ -1063,7 +1063,7 @@  discard block
 block discarded – undo
1063 1063
 
1064 1064
         // Then build a new array of top 10 editors by added text,
1065 1065
         //   in the data structure needed for the chart
1066
-        $this->topTenEditorsByAdded = array_map(function ($editor) {
1066
+        $this->topTenEditorsByAdded = array_map(function($editor) {
1067 1067
             $added = $this->editors[$editor]['added'];
1068 1068
             return [
1069 1069
                 'label' => $editor,
Please login to merge, or discard this patch.