Code Duplication    Length = 4-4 lines in 6 locations

src/AppBundle/Controller/AdminScoreController.php 1 location

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

src/AppBundle/Controller/AdminStatsController.php 1 location

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

src/AppBundle/Controller/ArticleInfoController.php 1 location

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

src/AppBundle/Controller/AutomatedEditsController.php 1 location

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

src/AppBundle/Controller/PagesController.php 1 location

@@ 124-127 (lines=4) @@
121
        $projectData = ProjectRepository::getProject($project, $this->container);
122
123
        // If the project exists, actually populate the values
124
        if (!$projectData->exists()) {
125
            $this->addFlash("notice", ["invalid-project", $project]);
126
            return $this->redirectToRoute("pages");
127
        }
128
129
        $dbName = $projectData->getDatabaseName();
130
        $projectUrl = $projectData->getUrl();

src/AppBundle/Controller/TopEditsController.php 1 location

@@ 112-115 (lines=4) @@
109
110
        $projectData = ProjectRepository::getProject($project, $this->container);
111
112
        if (!$projectData->exists()) {
113
            $this->addFlash("notice", ["invalid-project", $project]);
114
            return $this->redirectToRoute("topedits");
115
        }
116
117
        $user = UserRepository::getUser($username, $this->container);
118