Completed
Push — master ( ba8ed9...770316 )
by Jeroen
06:11
created

PagePartBundle/Form/LinkPagePartAdminType.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\PagePartBundle\Form;
4
5
use Kunstmaan\NodeBundle\Form\Type\URLChooserType;
6
use Symfony\Component\Form\AbstractType;
7
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
8
use Symfony\Component\Form\Extension\Core\Type\TextType;
9
use Symfony\Component\Form\FormBuilderInterface;
10
use Symfony\Component\OptionsResolver\OptionsResolver;
11
12
/**
13
 * LinkPagePartAdminType
14
 */
15 View Code Duplication
class LinkPagePartAdminType 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...
16
{
17
    /**
18
     * @param \Symfony\Component\Form\FormBuilderInterface $builder
19
     * @param array                                        $options
20
     */
21 1
    public function buildForm(FormBuilderInterface $builder, array $options)
22
    {
23
        $builder
24 1
            ->add('url', URLChooserType::class, array(
25 1
                'label' => false,
26
                'required' => false,
27
            ))
28 1
            ->add('openinnewwindow', CheckboxType::class, array(
29 1
                'label' => 'pagepart.link.openinnewwindow',
30
                'required' => false,
31
            ))
32 1
            ->add('text', TextType::class, array(
33 1
                'label' => 'pagepart.link.text',
34
                'required' => false,
35
            ));
36 1
    }
37
38
    /**
39
     * @return string
40
     */
41
    public function getBlockPrefix()
42
    {
43
        return 'kunstmaan_pagepartbundle_linkpageparttype';
44
    }
45
46
    /**
47
     * @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver
48
     */
49 1
    public function configureOptions(OptionsResolver $resolver)
50
    {
51 1
        $resolver->setDefaults(array(
52 1
            'data_class' => 'Kunstmaan\PagePartBundle\Entity\LinkPagePart',
53
        ));
54 1
    }
55
}
56