Code Duplication    Length = 10-10 lines in 5 locations

app/Http/Controllers/Admin/LinkController.php 1 location

@@ 147-156 (lines=10) @@
144
     *
145
     * @return array
146
     */
147
    protected function getLink()
148
    {
149
        $link = $this->linkModel->getById($this->request->getIntegerParam('link_id'));
150
151
        if (empty($link)) {
152
            throw new PageNotFoundException();
153
        }
154
155
        return $link;
156
    }
157
}
158

app/Http/Controllers/Controller.php 1 location

@@ 141-150 (lines=10) @@
138
     *
139
     * @return array
140
     */
141
    protected function getSubtask()
142
    {
143
        $subtask = $this->subtaskModel->getById($this->request->getIntegerParam('subtask_id'));
144
145
        if (empty($subtask)) {
146
            throw new PageNotFoundException();
147
        }
148
149
        return $subtask;
150
    }
151
}
152

app/Http/Controllers/Project/SwimlaneController.php 1 location

@@ 281-290 (lines=10) @@
278
     *
279
     * @return array
280
     */
281
    protected function getSwimlane()
282
    {
283
        $swimlane = $this->swimlaneModel->getById($this->request->getIntegerParam('swimlane_id'));
284
285
        if (empty($swimlane)) {
286
            throw new PageNotFoundException();
287
        }
288
289
        return $swimlane;
290
    }
291
}
292

app/Http/Controllers/Task/TaskInternalLinkController.php 1 location

@@ 151-160 (lines=10) @@
148
     *
149
     * @return array
150
     */
151
    protected function getTaskLink()
152
    {
153
        $link = $this->taskLinkModel->getById($this->request->getIntegerParam('link_id'));
154
155
        if (empty($link)) {
156
            throw new PageNotFoundException();
157
        }
158
159
        return $link;
160
    }
161
}
162

app/Http/Controllers/Project/CategoryController.php 1 location

@@ 178-187 (lines=10) @@
175
     *
176
     * @return array
177
     */
178
    protected function getCategory()
179
    {
180
        $category = $this->categoryModel->getById($this->request->getIntegerParam('category_id'));
181
182
        if (empty($category)) {
183
            throw new PageNotFoundException();
184
        }
185
186
        return $category;
187
    }
188
}
189