Code Duplication    Length = 45-47 lines in 2 locations

src/Surfnet/StepupRa/RaBundle/Form/Type/AmendRegistrationAuthorityInformationType.php 1 location

@@ 27-71 (lines=45) @@
24
use Symfony\Component\Form\FormBuilderInterface;
25
use Symfony\Component\OptionsResolver\OptionsResolver;
26
27
class AmendRegistrationAuthorityInformationType extends AbstractType
28
{
29
    public function buildForm(FormBuilderInterface $builder, array $options)
30
    {
31
        $builder
32
            ->add('location', TextareaType::class, [
33
                'label' => 'ra.management.form.amend_ra_info.label.location'
34
            ])
35
            ->add('contactInformation', TextareaType::class, [
36
                'label' => 'ra.management.form.amend_ra_info.label.contact_information',
37
                'attr' => ['class'=>'col-sm-2'],
38
            ])
39
            ->add(
40
                $builder->create(
41
                    'button-group',
42
                    ButtonGroupType::class,
43
                    [
44
                        'inherit_data' => true,
45
                    ]
46
                )
47
                ->add('amend_ra_info', SubmitType::class, [
48
                    'label' => 'ra.management.form.amend_ra_info.label.amend_ra_info',
49
                    'attr' => ['class' => 'btn btn-primary']
50
                ])
51
                ->add('cancel', AnchorType::class, [
52
                    'label' => 'ra.management.form.amend_ra_info.label.cancel',
53
                    'route' => 'ra_management_manage',
54
                    'attr'  => ['class' => 'btn btn-link cancel']
55
                ])
56
            )
57
        ;
58
    }
59
60
    public function configureOptions(OptionsResolver $resolver)
61
    {
62
        $resolver->setDefaults([
63
            'data_class' => 'Surfnet\StepupRa\RaBundle\Command\AmendRegistrationAuthorityInformationCommand'
64
        ]);
65
    }
66
67
    public function getBlockPrefix()
68
    {
69
        return 'ra_management_amend_ra_info';
70
    }
71
}
72

src/Surfnet/StepupRa/RaBundle/Form/Type/CreateRaLocationType.php 1 location

@@ 27-73 (lines=47) @@
24
use Symfony\Component\Form\FormBuilderInterface;
25
use Symfony\Component\OptionsResolver\OptionsResolver;
26
27
class CreateRaLocationType extends AbstractType
28
{
29
    public function buildForm(FormBuilderInterface $builder, array $options)
30
    {
31
        $builder
32
            ->add('name', null, [
33
                'label' => 'ra.form.ra_create_ra_location.label.name',
34
            ])
35
            ->add('location', TextareaType::class, [
36
                'label' => 'ra.form.ra_create_ra_location.label.location'
37
            ])
38
            ->add('contactInformation', TextareaType::class, [
39
                'label' => 'ra.form.ra_create_ra_location.label.contact_information'
40
            ])
41
            ->add(
42
                $builder->create(
43
                    'button-group',
44
                    ButtonGroupType::class,
45
                    [
46
                        'inherit_data' => true,
47
                    ]
48
                )
49
                ->add('create_ra_location', SubmitType::class, [
50
                    'label' => 'ra.form.ra_create_ra_location.label.create_ra_location',
51
                    'attr' => ['class' => 'btn btn-primary']
52
                ])
53
                ->add('cancel', AnchorType::class, [
54
                    'label' => 'ra.form.ra_create_ra_location.label.cancel',
55
                    'route' => 'ra_locations_manage',
56
                    'attr'  => ['class' => 'btn btn-link cancel']
57
                ])
58
            )
59
        ;
60
    }
61
62
    public function configureOptions(OptionsResolver $resolver)
63
    {
64
        $resolver->setDefaults([
65
            'data_class' => 'Surfnet\StepupRa\RaBundle\Command\CreateRaLocationCommand'
66
        ]);
67
    }
68
69
    public function getBlockPrefix()
70
    {
71
        return 'ra_create_ra_location';
72
    }
73
}
74