MediaShowType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
c 1
b 1
f 0
lcom 0
cbo 2
dl 0
loc 36
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 4 1
A buildForm() 0 11 1
A setDefaultOptions() 0 6 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Rafidion Michael
5
 * Date: 18/11/2014
6
 * Time: 01:22
7
 */
8
9
namespace Mykees\MediaBundle\Form\Type;
10
11
use Symfony\Component\Form\AbstractType;
12
use Symfony\Component\Form\FormBuilderInterface;
13
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
14
15
class MediaShowType extends AbstractType
16
{
17
    /**
18
     * @param FormBuilderInterface $builder
19
     * @param array $options
20
     */
21
    public function buildForm(FormBuilderInterface $builder, array $options)
22
    {
23
        $builder
24
            ->add('name','text',[
25
                "label"=>"Nom de l'image"
26
            ])
27
            ->add('file','text',[
28
                "label"=>"Chemin de l'image"
29
            ])
30
        ;
31
    }
32
33
    /**
34
     * @param OptionsResolverInterface $resolver
35
     */
36
    public function setDefaultOptions(OptionsResolverInterface $resolver)
37
    {
38
        $resolver->setDefaults(array(
39
            'data_class' => 'Mykees\MediaBundle\Entity\Media'
40
        ));
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getName()
47
    {
48
        return 'mykees_mediabundle_show';
49
    }
50
}
51