GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — develop ( f799d7...e8545c )
by Borut
14:35
created

ProfileType::buildForm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 47
Code Lines 29

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
c 2
b 1
f 0
dl 0
loc 47
rs 9.0303
cc 1
eloc 29
nc 1
nop 2
1
<?php
2
3
namespace Application\Form\Type;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\FormBuilderInterface;
7
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
8
9
/**
10
 * @author Borut Balažek <[email protected]>
11
 */
12
class ProfileType extends AbstractType
13
{
14
    /**
15
     * @param FormBuilderInterface $builder
16
     * @param $options
17
     */
18
    public function buildForm(FormBuilderInterface $builder, array $options)
19
    {
20
        $builder->add('title', 'text', array(
21
            'label' => 'Title',
22
            'required' => false,
23
        ));
24
25
        $builder->add('firstName', 'text', array(
26
            'label' => 'First name',
27
        ));
28
29
        $builder->add('middleName', 'text', array(
30
            'label' => 'Middle name',
31
            'required' => false,
32
        ));
33
34
        $builder->add('lastName', 'text', array(
35
            'label' => 'Last name',
36
            'required' => false,
37
        ));
38
39
        $builder->add(
40
            'gender',
41
            new GenderType(),
42
            array(
43
                'label' => 'Gender',
44
                'required' => false,
45
            )
46
        );
47
48
        $builder->add('birthdate', 'birthday', array(
49
            'label' => 'Birthdate',
50
            'required' => false,
51
        ));
52
53
        $builder->add('image', 'file', array(
54
            'required' => false,
55
        ));
56
        $builder->add('removeImage', 'checkbox', array(
57
            'required' => false,
58
            'data' => false,
59
            'label' => 'Remove image?',
60
            'attr' => array(
61
                'data-help-text' => 'Should the image be removed (goes into effect after the save)?',
62
            ),
63
        ));
64
    }
65
66
    /**
67
     * @param OptionsResolverInterface $resolver
68
     */
69 View Code Duplication
    public function setDefaultOptions(OptionsResolverInterface $resolver)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
70
    {
71
        $resolver->setDefaults(array(
72
            'data_class' => 'Application\Entity\ProfileEntity',
73
            'validation_groups' => array('newAndEdit'),
74
            'csrf_protection' => true,
75
            'csrf_field_name' => 'csrf_token',
76
        ));
77
    }
78
79
    /**
80
     * @return string
81
     */
82
    public function getName()
83
    {
84
        return 'profile';
85
    }
86
}
87