Code Duplication    Length = 4-4 lines in 6 locations

src/AppBundle/Controller/AdminStatsController.php 1 location

@@ 155-158 (lines=4) @@
152
        // Load the database information for the tool
153
        $projectData = ProjectRepository::getProject($project, $this->container);
154
155
        if (!$projectData->exists()) {
156
            $this->addFlash("notice", ["invalid-project", $project]);
157
            return $this->redirectToRoute("adminstats");
158
        }
159
160
        $dbName = $projectData->getDatabaseName();
161
        $wikiName = $projectData->getDatabaseName();

src/AppBundle/Controller/PagesController.php 1 location

@@ 101-104 (lines=4) @@
98
        $projectData = ProjectRepository::getProject($project, $this->container);
99
100
        // If the project exists, actually populate the values
101
        if (!$projectData->exists()) {
102
            $this->addFlash("notice", ["invalid-project", $project]);
103
            return $this->redirectToRoute("pages");
104
        }
105
106
        $dbName = $projectData->getDatabaseName();
107
        $projectUrl = $projectData->getUrl();

src/AppBundle/Controller/TopEditsController.php 1 location

@@ 100-103 (lines=4) @@
97
98
        $projectData = ProjectRepository::getProject($project, $this->container);
99
100
        if (!$projectData->exists()) {
101
            $this->addFlash("notice", ["invalid-project", $project]);
102
            return $this->redirectToRoute("topedits");
103
        }
104
105
        $user = UserRepository::getUser($username, $this->container);
106

src/AppBundle/Controller/AutomatedEditsController.php 1 location

@@ 111-114 (lines=4) @@
108
        // Pull information about the project
109
        $projectData = ProjectRepository::getProject($project, $this->container);
110
111
        if (!$projectData->exists()) {
112
            $this->addFlash('notice', ['invalid-project', $project]);
113
            return $this->redirectToRoute('autoedits');
114
        }
115
116
        $dbName = $projectData->getDatabaseName();
117
        $projectUrl = $projectData->getUrl();

src/AppBundle/Controller/AdminScoreController.php 1 location

@@ 74-77 (lines=4) @@
71
72
        $projectData = ProjectRepository::getProject($project, $this->container);
73
74
        if (!$projectData->exists()) {
75
            $this->addFlash("notice", ["invalid-project", $project]);
76
            return $this->redirectToRoute("adminscore");
77
        }
78
79
        $dbName = $projectData->getDatabaseName();
80
        $wikiName = $projectData->getDatabaseName();

src/AppBundle/Controller/ArticleInfoController.php 1 location

@@ 100-103 (lines=4) @@
97
    {
98
        $projectQuery = $request->attributes->get('project');
99
        $project = ProjectRepository::getProject($projectQuery, $this->container);
100
        if (!$project->exists()) {
101
            $this->addFlash('notice', ['invalid-project', $projectQuery]);
102
            return $this->redirectToRoute('articleInfo');
103
        }
104
        $projectUrl = $project->getUrl();
105
        $dbName = $project->getDatabaseName();
106