ResourcesType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 35
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 4 1
A configureOptions() 0 6 1
A getName() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of Webcook security bundle.
5
 *
6
 * See LICENSE file in the root of the bundle. Webcook 
7
 */
8
9
namespace Webcook\Cms\SecurityBundle\Form\Type;
10
11
use Symfony\Component\Form\AbstractType;
12
use Symfony\Component\Form\FormBuilderInterface;
13
use Symfony\Component\OptionsResolver\OptionsResolver;
14
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
15
16
/**
17
 * Resources collection form.
18
 */
19
class ResourcesType extends AbstractType
20
{
21
    /**
22
     * {@inheritdoc}
23
     *
24
     * @param FormBuilderInterface $builder
25
     * @param array                $options
26
     */
27 1
    public function buildForm(FormBuilderInterface $builder, array $options)
28
    {
29 1
        $builder->add('roleResources', CollectionType::class, array('entry_type' => ResourceType::class));
30 1
    }
31
32
    /**
33
     * {@inheritdoc}
34
     *
35
     * @param OptionsResolver $resolver
36
     */
37 1
    public function configureOptions(OptionsResolver $resolver)
38
    {
39 1
        $resolver->setDefaults(array(
40 1
            'csrf_protection'   => false,
41
        ));
42 1
    }
43
44
    /**
45
     * {@inheritdoc}
46
     *
47
     * @return string
48
     */
49
    public function getName()
50
    {
51
        return 'resources';
52
    }
53
}
54