Code Duplication    Length = 29-29 lines in 2 locations

app/Form/Issue.php 2 locations

@@ 186-214 (lines=29) @@
183
     *
184
     * @return array
185
     */
186
    protected function fieldStatusTags()
187
    {
188
        $currentTag = $this->getIssueTag('status');
189
190
        if ($currentTag && !$currentTag->canView()) {
191
            $tags = [$currentTag];
192
        } else {
193
            $tags = $this->getTags('status');
194
        }
195
196
        $options = [];
197
        foreach ($tags as $tag) {
198
            $options[ucwords($tag->name)] = [
199
                'name'      => 'tag_status',
200
                'value'     => $tag->id,
201
                'data-tags' => $tag->id,
202
                'color'     => $tag->bgcolor,
203
            ];
204
        }
205
206
        $fields['tag_status'] = [
207
            'label'  => 'status',
208
            'type'   => 'radioButton',
209
            'radios' => $options,
210
            'check'  => $this->getIssueTag('status')->id,
211
        ];
212
213
        return $fields;
214
    }
215
216
    /**
217
     * Returns tags field.
@@ 221-249 (lines=29) @@
218
     *
219
     * @return array
220
     */
221
    protected function fieldTypeTags()
222
    {
223
        $currentTag = $this->getIssueTag('type');
224
225
        if ($currentTag && !$currentTag->canView()) {
226
            $tags = [$currentTag];
227
        } else {
228
            $tags = $this->getTags('type');
229
        }
230
231
        $options = [];
232
        foreach ($tags as $tag) {
233
            $options[ucwords($tag->name)] = [
234
                'name'      => 'tag_type',
235
                'value'     => $tag->id,
236
                'data-tags' => $tag->id,
237
                'color'     => $tag->bgcolor,
238
            ];
239
        }
240
241
        $fields['tag_type'] = [
242
            'label'  => 'type',
243
            'type'   => 'radioButton',
244
            'radios' => $options,
245
            'check'  => $this->getIssueTag('type')->id,
246
        ];
247
248
        return $fields;
249
    }
250
251
    /**
252
     * Returns tags field.