Completed
Pull Request — master (#104)
by MusikAnimal
02:52
created
src/AppBundle/Controller/TopEditsController.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@
 block discarded – undo
155 155
      * @param Request $request The HTTP request.
156 156
      * @param User $user The User.
157 157
      * @param Project $project The project.
158
-     * @param integer|string $namespace The namespace ID or 'all'
158
+     * @param integer $namespace The namespace ID or 'all'
159 159
      * @return \Symfony\Component\HttpFoundation\Response
160 160
      */
161 161
     public function namespaceTopEdits(Request $request, User $user, Project $project, $namespace)
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,6 @@
 block discarded – undo
5 5
 
6 6
 namespace AppBundle\Controller;
7 7
 
8
-use AppBundle\Helper\ApiHelper;
9 8
 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
10 9
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
11 10
 use Symfony\Component\HttpFoundation\RedirectResponse;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             'xtSubtitle' => 'tool-topedits-desc',
97 97
             'xtPage' => 'topedits',
98 98
             'project' => $project,
99
-            'namespace' => (int) $namespace,
99
+            'namespace' => (int)$namespace,
100 100
             'article' => $article,
101 101
         ]);
102 102
     }
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         // Send all to the template.
249 249
         return $this->render('topedits/result_article.html.twig', [
250 250
             'xtPage' => 'topedits',
251
-            'xtTitle' => $user->getUsername() . ' - ' . $page->getTitle(),
251
+            'xtTitle' => $user->getUsername().' - '.$page->getTitle(),
252 252
             'project' => $project,
253 253
             'user' => $user,
254 254
             'page' => $page,
Please login to merge, or discard this patch.
src/Xtools/TopEdits.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,6 @@
 block discarded – undo
105 105
     /**
106 106
      * Get the top edits by a user in the given namespace.
107 107
      * @param int $namespace Namespace ID.
108
-     * @param int $limit Number of edits to fetch.
109 108
      * @return string[] page_namespace, page_title, page_is_redirect,
110 109
      *   count (number of edits), assessment (page assessment).
111 110
      */
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -5,9 +5,6 @@
 block discarded – undo
5 5
 
6 6
 namespace Xtools;
7 7
 
8
-use Symfony\Component\DependencyInjection\Container;
9
-use DateTime;
10
-
11 8
 /**
12 9
  * TopEdits returns the top-edited pages by a user. There is not a separate
13 10
  * repository because there is only one query :)
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -124,9 +124,9 @@  discard block
 block discarded – undo
124 124
         $pages = [];
125 125
         foreach ($topPages as $page) {
126 126
             // If non-mainspace, prepend namespace to the titles.
127
-            $ns = (int) $page['page_namespace'];
128
-            $nsTitle = $ns > 0 ? $this->project->getNamespaces()[$page['page_namespace']] . ':' : '';
129
-            $pageTitle = $nsTitle . $page['page_title'];
127
+            $ns = (int)$page['page_namespace'];
128
+            $nsTitle = $ns > 0 ? $this->project->getNamespaces()[$page['page_namespace']].':' : '';
129
+            $pageTitle = $nsTitle.$page['page_title'];
130 130
             $page['displaytitle'] = $displayTitles[$pageTitle];
131 131
             // $page['page_title'] is retained without the namespace
132 132
             //  so we can link to TopEdits for that page.
@@ -147,11 +147,11 @@  discard block
 block discarded – undo
147 147
         $namespaces = $this->project->getNamespaces();
148 148
 
149 149
         // First extract page titles including namespace.
150
-        $pageTitles = array_map(function ($page) use ($namespaces) {
150
+        $pageTitles = array_map(function($page) use ($namespaces) {
151 151
             // If non-mainspace, prepend namespace to the titles.
152 152
             $ns = $page['page_namespace'];
153
-            $nsTitle = $ns > 0 ? $namespaces[$page['page_namespace']] . ':' : '';
154
-            return $nsTitle . $page['page_title'];
153
+            $nsTitle = $ns > 0 ? $namespaces[$page['page_namespace']].':' : '';
154
+            return $nsTitle.$page['page_title'];
155 155
         }, $topPages);
156 156
 
157 157
         return $this->getRepository()->getDisplayTitles($this->project, $pageTitles);
Please login to merge, or discard this patch.