IdentityType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 35
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 10 1
A configureOptions() 0 7 1
A getBlockPrefix() 0 4 1
1
<?php
2
/*
3
 * This file is part of the FreshSinchBundle
4
 *
5
 * (c) Artem Henvald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Fresh\SinchBundle\Form\Type;
14
15
use Fresh\SinchBundle\Model\Identity;
16
use Symfony\Component\Form\AbstractType;
17
use Symfony\Component\Form\Extension\Core\Type as CoreType;
18
use Symfony\Component\Form\FormBuilderInterface;
19
use Symfony\Component\OptionsResolver\OptionsResolver;
20
21
/**
22
 * IdentityType.
23
 *
24
 * @author Artem Henvald <[email protected]>
25
 */
26
class IdentityType extends AbstractType
27
{
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function buildForm(FormBuilderInterface $builder, array $options): void
32
    {
33
        $builder
34
            ->add('type', CoreType\TextType::class, [
35
                'required' => true,
36
            ])
37
            ->add('endpoint', CoreType\TextType::class, [
38
                'required' => true,
39
            ]);
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function configureOptions(OptionsResolver $resolver): void
46
    {
47
        $resolver->setDefaults([
48
            'data_class' => Identity::class,
49
            'csrf_protection' => false,
50
        ]);
51
    }
52
53
    /**
54
     * {@inheritdoc}
55
     */
56
    public function getBlockPrefix(): string
57
    {
58
        return '';
59
    }
60
}
61