Completed
Push — master ( 91fdab...75a7b9 )
by
unknown
13:37
created

FormBundle/Form/MultiLineTextPagePartAdminType.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Kunstmaan\FormBundle\Form;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
7
use Symfony\Component\Form\Extension\Core\Type\TextType;
8
use Symfony\Component\Form\FormBuilderInterface;
9
use Symfony\Component\OptionsResolver\OptionsResolver;
10
11
/**
12
 * This class represents the type for the MultiLineTextPagePart
13
 */
14 View Code Duplication
class MultiLineTextPagePartAdminType extends AbstractType
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
15
{
16
17
    /**
18
     * @param FormBuilderInterface $builder The form builder
19
     * @param array                $options The options
20
     */
21
    public function buildForm(FormBuilderInterface $builder, array $options)
22
    {
23
        $builder
24
            ->add('label', TextType::class, array(
25
                'required' => true,
26
                'label' => 'kuma_form.form.multi_line_text_page_part.label.label',
27
            ))
28
            ->add('required', CheckboxType::class, array(
29
                'required' => false,
30
                'label' => 'kuma_form.form.multi_line_text_page_part.required.label',
31
            ))
32
            ->add('errormessage_required', TextType::class, array(
33
                'required' => false,
34
                'label' => 'kuma_form.form.multi_line_text_page_part.errormessage_required.label',
35
            ))
36
            ->add('regex', TextType::class, array(
37
                'required' => false,
38
                'label' => 'kuma_form.form.multi_line_text_page_part.regex.label',
39
            ))
40
            ->add('errormessage_regex', TextType::class, array(
41
                'required' => false,
42
                'label' => 'kuma_form.form.multi_line_text_page_part.errormessage_regex.label',
43
            ))
44
        ;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getBlockPrefix()
51
    {
52
        return 'kunstmaan_formbundle_singlelinetextpageparttype';
53
    }
54
55
    /**
56
     * @param OptionsResolver $resolver
57
     */
58
    public function configureOptions(OptionsResolver $resolver)
59
    {
60
        $resolver->setDefaults(array('data_class' => 'Kunstmaan\FormBundle\Entity\PageParts\MultiLineTextPagePart'));
61
    }
62
}
63