Code Duplication    Length = 12-12 lines in 2 locations

src/Enhavo/Bundle/FormBundle/Form/Type/HtmlTagType.php 2 locations

@@ 26-37 (lines=12) @@
23
    {
24
        $builder->add('text', TextType::class);
25
26
        if (is_array($options['tag_choices'])) {
27
            $choices = [];
28
            foreach($options['tag_choices'] as $option) {
29
                $choices[$option] = $option;
30
            }
31
32
            $builder->add('tag', ChoiceType::class, [
33
                'choices' => $choices,
34
                'placeholder' => $options['tag_placeholder'],
35
                'empty_data' => null,
36
            ]);
37
        }
38
39
        if (is_array($options['class_choices'])) {
40
            $choices = [];
@@ 39-50 (lines=12) @@
36
            ]);
37
        }
38
39
        if (is_array($options['class_choices'])) {
40
            $choices = [];
41
            foreach($options['class_choices'] as $option) {
42
                $choices[$option] = $option;
43
            }
44
45
            $builder->add('class', ChoiceType::class, [
46
                'choices' => $choices,
47
                'placeholder' => 'class_placeholder',
48
                'empty_data' => null,
49
            ]);
50
        }
51
52
        $builder->addModelTransformer(new CallbackTransformer(
53
            function ($original) use ($options) {