Code Duplication    Length = 4-4 lines in 6 locations

src/AppBundle/Controller/ArticleInfoController.php 1 location

@@ 117-120 (lines=4) @@
114
        $projectQuery = $request->attributes->get('project');
115
        $project = ProjectRepository::getProject($projectQuery, $this->container);
116
        $this->projectRepo = $project->getRepository();
117
        if (!$project->exists()) {
118
            $this->addFlash('notice', ['invalid-project', $projectQuery]);
119
            return $this->redirectToRoute('articleInfo');
120
        }
121
        $this->dbName = $project->getDatabaseName();
122
123
        $pageQuery = $request->attributes->get('article');

src/AppBundle/Controller/AdminScoreController.php 1 location

@@ 84-87 (lines=4) @@
81
        $projectData = ProjectRepository::getProject($project, $this->container);
82
        $projectRepo = $projectData->getRepository();
83
84
        if (!$projectData->exists()) {
85
            $this->addFlash("notice", ["invalid-project", $project]);
86
            return $this->redirectToRoute("adminscore");
87
        }
88
89
        $dbName = $projectData->getDatabaseName();
90

src/AppBundle/Controller/AdminStatsController.php 1 location

@@ 148-151 (lines=4) @@
145
        $projectData = ProjectRepository::getProject($project, $this->container);
146
        $projectRepo = $projectData->getRepository();
147
148
        if (!$projectData->exists()) {
149
            $this->addFlash('notice', ['invalid-project', $project]);
150
            return $this->redirectToRoute('adminstats');
151
        }
152
153
        $dbName = $projectData->getDatabaseName();
154

src/AppBundle/Controller/TopEditsController.php 1 location

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

src/AppBundle/Controller/AutomatedEditsController.php 1 location

@@ 128-131 (lines=4) @@
125
        // Pull information about the project
126
        $projectData = ProjectRepository::getProject($project, $this->container);
127
128
        if (!$projectData->exists()) {
129
            $this->addFlash('notice', ['invalid-project', $project]);
130
            return $this->redirectToRoute('autoedits');
131
        }
132
133
        $dbName = $projectData->getDatabaseName();
134

src/AppBundle/Controller/PagesController.php 1 location

@@ 122-125 (lines=4) @@
119
        $projectRepo = $projectData->getRepository();
120
121
        // If the project exists, actually populate the values
122
        if (!$projectData->exists()) {
123
            $this->addFlash('notice', ['invalid-project', $project]);
124
            return $this->redirectToRoute('pages');
125
        }
126
        if (!$user->existsOnProject($projectData)) {
127
            $this->addFlash('notice', ['user-not-found']);
128
            return $this->redirectToRoute('pages');