Code Duplication    Length = 7-7 lines in 2 locations

src/Http/Api/IssueController.php 2 locations

@@ 1021-1027 (lines=7) @@
1018
            ->first();
1019
        if ($res) {
1020
            $filters = isset($res['filters']) ? $res['filters'] : [];
1021
            foreach($filters as $filter)
1022
            {
1023
                if (isset($filter['name']) && $filter['name'] === $name) {
1024
                    throw new \UnexpectedValueException('filter name cannot be repeated', -11106);
1025
                }
1026
            }
1027
            array_push($filters, [ 'id' => md5(microtime()), 'name' => $name, 'query' => $query ]);
1028
            $res->filters = $filters;
1029
            $res->save();
1030
        }
@@ 1034-1040 (lines=7) @@
1031
        else
1032
        {
1033
            $filters = Provider::getDefaultIssueFilters();
1034
            foreach($filters as $filter)
1035
            {
1036
                if (isset($filter['name']) && $filter['name'] === $name) {
1037
                    throw new \UnexpectedValueException('filter name cannot be repeated', -11106);
1038
                }
1039
            }
1040
            array_push($filters, [ 'id' => md5(microtime()), 'name' => $name, 'query' => $query ]);
1041
            UserIssueFilters::create([ 'project_key' => $project_key, 'user' => $this->user->id, 'filters' => $filters ]); 
1042
        }
1043
        return $this->getIssueFilters($project_key);