Completed
Pull Request — master (#115)
by MusikAnimal
05:00
created
src/AppBundle/Controller/ArticleInfoController.php 1 patch
Unused Use Statements   -4 removed lines patch added patch discarded remove patch
@@ -8,13 +8,9 @@
 block discarded – undo
8 8
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
9 9
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
10 10
 use Symfony\Component\HttpFoundation\Request;
11
-use Symfony\Component\DependencyInjection\ContainerInterface;
12 11
 use Symfony\Component\HttpFoundation\Response;
13 12
 use Symfony\Component\Process\Process;
14 13
 use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
15
-use Xtools\ProjectRepository;
16
-use Xtools\Page;
17
-use Xtools\PagesRepository;
18 14
 use Xtools\ArticleInfo;
19 15
 use Xtools\ArticleInfoRepository;
20 16
 
Please login to merge, or discard this patch.
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
     }
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
 
640 640
             if ($revCount === 0) {
641 641
                 $this->firstEdit = $edit;
642
-                $firstEditMonth = mktime(0, 0, 0, (int) $this->firstEdit->getMonth(), 1, $this->firstEdit->getYear());
642
+                $firstEditMonth = mktime(0, 0, 0, (int)$this->firstEdit->getMonth(), 1, $this->firstEdit->getYear());
643 643
             }
644 644
 
645 645
             $username = $edit->getUser()->getUsername();
@@ -831,14 +831,14 @@  discard block
 block discarded – undo
831 831
         $botData = $this->getRepository()->getBotData($this->page);
832 832
         while ($bot = $botData->fetch()) {
833 833
             $bots[$bot['username']] = [
834
-                'count' => (int) $bot['count'],
834
+                'count' => (int)$bot['count'],
835 835
                 'current' => $bot['current'] === 'bot'
836 836
             ];
837 837
         }
838 838
 
839 839
         // Sort by edit count.
840
-        uasort($bots, function ($a, $b) {
841
-            return $b['count'] - $a['count'];
840
+        uasort($bots, function($a, $b) {
841
+            return $b['count']-$a['count'];
842 842
         });
843 843
 
844 844
         $this->bots = $bots;
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
 
951 951
             if ($info['all'] > 1) {
952 952
                 // Number of seconds/days between first and last edit
953
-                $secs = $info['last']->getTimestamp() - $info['first']->getTimestamp();
953
+                $secs = $info['last']->getTimestamp()-$info['first']->getTimestamp();
954 954
                 $days = $secs / (60 * 60 * 24);
955 955
 
956 956
                 // Average time between edits (in days)
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
 
970 970
         // First sort editors array by the amount of text they added
971 971
         $topTenEditorsByAdded = $this->editors;
972
-        uasort($topTenEditorsByAdded, function ($a, $b) {
972
+        uasort($topTenEditorsByAdded, function($a, $b) {
973 973
             if ($a['added'] === $b['added']) {
974 974
                 return 0;
975 975
             }
@@ -978,7 +978,7 @@  discard block
 block discarded – undo
978 978
 
979 979
         // Then build a new array of top 10 editors by added text,
980 980
         //   in the data structure needed for the chart
981
-        $this->topTenEditorsByAdded = array_map(function ($editor) {
981
+        $this->topTenEditorsByAdded = array_map(function($editor) {
982 982
             $added = $this->editors[$editor]['added'];
983 983
             return [
984 984
                 'label' => $editor,
Please login to merge, or discard this patch.