SchemaType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 7
Bugs 1 Features 1
Metric Value
wmc 3
c 7
b 1
f 1
lcom 0
cbo 4
dl 0
loc 24
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 9 1
A setDefaultOptions() 0 6 1
A getName() 0 4 1
1
<?php
2
3
namespace Padam87\AttributeBundle\Form;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\FormBuilderInterface;
7
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
8
9
class SchemaType extends AbstractType
10
{
11
    public function buildForm(FormBuilderInterface $builder, array $options)
12
    {
13
        $builder->add('definitions', 'collection', [
14
            'type' => new DefinitionType(),
15
            'allow_add' => true,
16
            'allow_delete' => true,
17
            'by_reference' => false,
18
        ]);
19
    }
20
21
    public function setDefaultOptions(OptionsResolverInterface $resolver)
22
    {
23
        $resolver->setDefaults([
24
            'data_class' => 'Padam87\AttributeBundle\Entity\Schema',
25
        ]);
26
    }
27
28
    public function getName()
29
    {
30
        return 'schema';
31
    }
32
}
33