Code Duplication    Length = 9-9 lines in 2 locations

src/Http/Api/IssueController.php 1 location

@@ 1175-1183 (lines=9) @@
1172
                    }
1173
                }
1174
            }
1175
            if ($res) {
1176
                $res->filters = $new_filters;
1177
                $res->save();
1178
            }
1179
            else
1180
            {
1181
                UserIssueFilters::create([ 'project_key' => $project_key, 'user' => $this->user->id, 'filters' => $new_filters ]); 
1182
            }
1183
        }
1184
        return $this->getIssueFilters($project_key);
1185
    }
1186

src/Http/Api/ReportController.php 1 location

@@ 280-288 (lines=9) @@
277
                }
278
            }
279
280
            if ($res) {
281
                $res->filters = $new_filters;
282
                $res->save();
283
            }
284
            else
285
            {
286
                ReportFilters::create([ 'project_key' => $project_key, 'mode' => $mode, 'user' => $this->user->id, 'filters' => $new_filters ]); 
287
            }
288
        }
289
290
        return $this->getSomeFilters($project_key, $mode);
291
    }