NodeAdminType::configureOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 6
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 6
loc 6
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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\FormBuilderInterface;
8
use Symfony\Component\OptionsResolver\OptionsResolver;
9
10
/**
11
 * NodeAdminType
12
 */
13 View Code Duplication
class NodeAdminType 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...
14
{
15
    /**
16
     * @param FormBuilderInterface $builder
17
     * @param array                $options
18
     */
19
    public function buildForm(FormBuilderInterface $builder, array $options)
20
    {
21
        $builder->add('id', HiddenType::class);
22
    }
23
24
    /**
25
     * @return string
26
     */
27
    public function getBlockPrefix()
28
    {
29
        return 'node';
30
    }
31
32
    public function configureOptions(OptionsResolver $resolver)
33
    {
34
        $resolver->setDefaults(array(
35
            'data_class' => 'Kunstmaan\NodeBundle\Entity\Node',
36
        ));
37
    }
38
}
39