Code Duplication    Length = 26-28 lines in 2 locations

src/AppBundle/Controller/EditSummaryController.php 1 location

@@ 80-105 (lines=26) @@
77
     * @return Response
78
     * @codeCoverageIgnore
79
     */
80
    public function resultAction(Request $request, $namespace = 0)
81
    {
82
        $ret = $this->validateProjectAndUser($request, 'es');
83
        if ($ret instanceof RedirectResponse) {
84
            return $ret;
85
        } else {
86
            list($project, $user) = $ret;
87
        }
88
89
        // Instantiate an EditSummary, treating the past 150 edits as 'recent'.
90
        $editSummary = new EditSummary($project, $user, $namespace, 150, $this->container);
91
        $editSummary->prepareData();
92
93
        // Assign the values and display the template
94
        return $this->render(
95
            'editSummary/result.html.twig',
96
            [
97
                'xtPage' => 'es',
98
                'xtTitle' => $user->getUsername(),
99
                'user' => $user,
100
                'project' => $project,
101
                'namespace' => $namespace,
102
                'es' => $editSummary,
103
            ]
104
        );
105
    }
106
107
    /************************ API endpoints ************************/
108

src/AppBundle/Controller/PagesController.php 1 location

@@ 79-106 (lines=28) @@
76
     * @return RedirectResponse|Response
77
     * @codeCoverageIgnore
78
     */
79
    public function resultAction(Request $request, $namespace = '0', $redirects = 'noredirects', $offset = 0)
80
    {
81
        $ret = $this->validateProjectAndUser($request, 'pages');
82
        if ($ret instanceof RedirectResponse) {
83
            return $ret;
84
        } else {
85
            list($projectData, $user) = $ret;
86
        }
87
88
        $pages = new Pages(
89
            $projectData,
90
            $user,
91
            $namespace,
92
            $redirects,
93
            $offset
94
        );
95
        $pages->prepareData();
96
97
        // Assign the values and display the template
98
        return $this->render('pages/result.html.twig', [
99
            'xtPage' => 'pages',
100
            'xtTitle' => $user->getUsername(),
101
            'project' => $projectData,
102
            'user' => $user,
103
            'summaryColumns' => $this->getSummaryColumns($redirects),
104
            'pages' => $pages,
105
        ]);
106
    }
107
108
    /**
109
     * What columns to show in namespace totals table.