Code Duplication    Length = 13-13 lines in 2 locations

app/Form/Issue.php 1 location

@@ 120-132 (lines=13) @@
117
    protected function fieldTags()
118
    {
119
        // Populate tag fields with the submitted tags
120
        if ($this->isEditing()) {
121
            $selectTags = $this->getModel()->tags()->with('parent')->get()->filter(function (Model\Tag $tag) {
122
                return !($tag->name == Model\Tag::STATUS_OPEN || $tag->name == Model\Tag::STATUS_CLOSED);
123
            })->map(function (Model\Tag $tag) {
124
                return [
125
                    'value' => $tag->id,
126
                    'label' => ($tag->fullname),
127
                    'bgcolor' => $tag->bgcolor,
128
                ];
129
            })->toJson();
130
        } else {
131
            $selectTags = '';
132
        }
133
134
        return [
135
            'tag' => [

app/Form/Project.php 1 location

@@ 96-108 (lines=13) @@
93
        ];
94
95
        $statusTags = (new TagModel())->getStatusTags()->tags()->get()->implode('fullname', ', ');
96
        if ($this->isEditing()) {
97
            $selectTags = $this->getModel()->kanbanTags()->get()->filter(function (TagModel $tag) {
98
                return !($tag->name == TagModel::STATUS_OPEN || $tag->name == TagModel::STATUS_CLOSED);
99
            })->map(function (TagModel $tag) {
100
                return [
101
                    'value' => $tag->id,
102
                    'label' => ($tag->fullname),
103
                    'bgcolor' => $tag->bgcolor,
104
                ];
105
            })->toJson();
106
        } else {
107
            $selectTags = (new TagModel())->tagsToJson(\Request::input('tags'));
108
        }
109
        $fields['columns'] = [
110
            'type' => 'text',
111
            'label' => 'columns',