ContentType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
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 32
ccs 12
cts 12
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 10 1
A getBlockPrefix() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Ivoaz ContentEditable bundle.
5
 *
6
 * (c) Ivo Azirjans <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace Ivoaz\Bundle\ContentEditableBundle\Form\Type;
13
14
use Ivoaz\Bundle\ContentEditableBundle\Form\Model\Content;
15
use Symfony\Component\Form\AbstractType;
16
use Symfony\Component\Form\FormBuilderInterface;
17
use Symfony\Component\OptionsResolver\OptionsResolver;
18
19
/**
20
 * @author Ivo Azirjans <[email protected]>
21
 */
22
class ContentType extends AbstractType
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27 2
    public function buildForm(FormBuilderInterface $builder, array $options)
28
    {
29 2
        $builder->add('text');
30 2
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35 2
    public function configureOptions(OptionsResolver $resolver)
36
    {
37 2
        $resolver->setDefaults(
38
            [
39 2
                'data_class'      => Content::class,
40 2
                'csrf_protection' => false,
41 2
                'method'          => 'PUT',
42
            ]
43 2
        );
44 2
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49 1
    public function getBlockPrefix()
50
    {
51 1
        return '';
52
    }
53
}
54