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

FormBundle/Form/FileUploadPagePartAdminType.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 file FileUploadPagePart
13
 */
14 View Code Duplication
class FileUploadPagePartAdminType 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.file_upload_page_part.label.label',
27
            ))
28
            ->add('required', CheckboxType::class, array(
29
                'required' => false,
30
                'label' => 'kuma_form.form.file_upload_page_part.required.label',
31
            ))
32
            ->add('errormessage_required', TextType::class, array(
33
                'required' => false,
34
                'label' => 'kuma_form.form.file_upload_page_part.errormessage_required.label',
35
            ))
36
        ;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getBlockPrefix()
43
    {
44
        return 'kunstmaan_formbundle_fileuploadpageparttype';
45
    }
46
47
    /**
48
     * @param OptionsResolver $resolver
49
     */
50
    public function configureOptions(OptionsResolver $resolver)
51
    {
52
        $resolver->setDefaults(array('data_class' => 'Kunstmaan\FormBundle\Entity\PageParts\FileUploadPagePart'));
53
    }
54
}
55