Completed
Pull Request — 5.0 (#2163)
by Kevin
13:16
created

ControllerActionAdminType::buildForm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
dl 7
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Kunstmaan\NodeBundle\Form;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
7
use Symfony\Component\Form\Extension\Core\Type\TextType;
8
use Symfony\Component\Form\FormBuilderInterface;
9
use Symfony\Component\OptionsResolver\OptionsResolver;
10
11
/**
12
 * ControllerActionAdminType
13
 */
14 View Code Duplication
class ControllerActionAdminType extends AbstractType
0 ignored issues
show
Duplication introduced by
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
19
     * @param array                $options
20
     */
21
    public function buildForm(FormBuilderInterface $builder, array $options)
22
    {
23
        $builder->add('id', HiddenType::class);
24
        $builder->add('title', TextType::class, array(
25
            'label' => 'kuma_node.form.controller_action.title.label',
26
        ));
27
    }
28
29
    public function configureOptions(OptionsResolver $resolver)
30
    {
31
        $resolver->setDefaults(array(
32
            'data_class' => 'Kunstmaan\NodeBundle\Entity\AbstractControllerAction',
33
        ));
34
    }
35
36
    /**
37
     * @return string
38
     */
39
    public function getBlockPrefix()
40
    {
41
        return 'controller_action';
42
    }
43
44
}
45