Code Duplication    Length = 22-23 lines in 3 locations

src/AppBundle/Controller/AutomatedEditsController.php 1 location

@@ 45-67 (lines=23) @@
42
     * @param Request $request The HTTP request.
43
     * @return Response
44
     */
45
    public function indexAction(Request $request)
46
    {
47
        $params = $this->parseQueryParams($request);
48
49
        // Redirect if at minimum project and username are provided.
50
        if (isset($params['project']) && isset($params['username'])) {
51
            return $this->redirectToRoute('autoeditsResult', $params);
52
        }
53
54
        // Convert the given project (or default project) into a Project instance.
55
        $params['project'] = $this->getProjectFromQuery($params);
56
57
        return $this->render('autoEdits/index.html.twig', array_merge([
58
            'xtPageTitle' => 'tool-autoedits',
59
            'xtSubtitle' => 'tool-autoedits-desc',
60
            'xtPage' => 'autoedits',
61
62
            // Defaults that will get overriden if in $params.
63
            'namespace' => 0,
64
            'start' => '',
65
            'end' => '',
66
        ], $params));
67
    }
68
69
    /**
70
     * Display the results.

src/AppBundle/Controller/PagesController.php 1 location

@@ 43-65 (lines=23) @@
40
     * @param Request $request
41
     * @return Response
42
     */
43
    public function indexAction(Request $request)
44
    {
45
        $params = $this->parseQueryParams($request);
46
47
        // Redirect if at minimum project and username are given.
48
        if (isset($params['project']) && isset($params['username'])) {
49
            return $this->redirectToRoute('PagesResult', $params);
50
        }
51
52
        // Convert the given project (or default project) into a Project instance.
53
        $params['project'] = $this->getProjectFromQuery($params);
54
55
        // Otherwise fall through.
56
        return $this->render('pages/index.html.twig', array_merge([
57
            'xtPageTitle' => 'tool-pages',
58
            'xtSubtitle' => 'tool-pages-desc',
59
            'xtPage' => 'pages',
60
61
            // Defaults that will get overriden if in $params.
62
            'namespace' => 0,
63
            'redirects' => 'noredirects',
64
        ], $params));
65
    }
66
67
    /**
68
     * Display the results.

src/AppBundle/Controller/TopEditsController.php 1 location

@@ 49-70 (lines=22) @@
46
     * @param Request $request
47
     * @return Response
48
     */
49
    public function indexAction(Request $request)
50
    {
51
        $params = $this->parseQueryParams($request);
52
53
        // Redirect if at minimum project and username are provided.
54
        if (isset($params['project']) && isset($params['username'])) {
55
            return $this->redirectToRoute('TopEditsResults', $params);
56
        }
57
58
        // Convert the given project (or default project) into a Project instance.
59
        $params['project'] = $this->getProjectFromQuery($params);
60
61
        return $this->render('topedits/index.html.twig', array_merge([
62
            'xtPageTitle' => 'tool-topedits',
63
            'xtSubtitle' => 'tool-topedits-desc',
64
            'xtPage' => 'topedits',
65
66
            // Defaults that will get overriden if in $params.
67
            'namespace' => 0,
68
            'article' => '',
69
        ], $params));
70
    }
71
72
    /**
73
     * Display the results.