Filler   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 51
c 0
b 0
f 0
ccs 0
cts 25
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A buildForm() 0 11 1
A configureOptions() 0 6 1
A getName() 0 4 1
1
<?php
2
/**
3
 * AnimeDb package.
4
 *
5
 * @author    Peter Gribanov <[email protected]>
6
 * @copyright Copyright (c) 2011, Peter Gribanov
7
 * @license   http://opensource.org/licenses/GPL-3.0 GPL v3
8
 */
9
namespace AnimeDb\Bundle\AniDbFillerBundle\Form\Type;
10
11
use Symfony\Component\Form\AbstractType;
12
use Symfony\Component\Form\FormBuilderInterface;
13
use Symfony\Component\OptionsResolver\OptionsResolver;
14
15
/**
16
 * Get item from filler.
17
 */
18
class Filler extends AbstractType
19
{
20
    /**
21
     * HTTP host.
22
     *
23
     * @var string
24
     */
25
    protected $host;
26
27
    /**
28
     * @param string $host
29
     */
30
    public function __construct($host)
31
    {
32
        $this->host = $host;
33
    }
34
35
    /**
36
     * @param FormBuilderInterface $builder
37
     * @param array $options
38
     */
39
    public function buildForm(FormBuilderInterface $builder, array $options)
40
    {
41
        $builder
42
            ->setMethod('GET')
43
            ->add('url', 'text', [
44
                'label' => 'URL address',
45
                'attr' => [
46
                    'placeholder' => $this->host.'/',
47
                ],
48
            ]);
49
    }
50
51
    /**
52
     * @param OptionsResolver $resolver
53
     */
54
    public function configureOptions(OptionsResolver $resolver)
55
    {
56
        $resolver->setDefaults([
57
            'csrf_protection' => false,
58
        ]);
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getName()
65
    {
66
        return 'animedb_anidbfillerbundle_filler';
67
    }
68
}
69