Passed
Push — master ( 419cb0...e1d6fa )
by Anthony
02:38
created

Account::buildForm()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 25
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 17
nc 1
nop 2
dl 0
loc 25
rs 8.8571
c 0
b 0
f 0
1
<?php
2
3
namespace PiouPiou\RibsAdminBundle\Form;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\Extension\Core\Type\EmailType;
7
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
8
use Symfony\Component\Form\Extension\Core\Type\TextType;
9
use Symfony\Component\Form\FormBuilderInterface;
10
use Symfony\Component\OptionsResolver\OptionsResolver;
11
12
class Account extends AbstractType
13
{
14
	public function buildForm(FormBuilderInterface $builder, array $options)
15
	{
16
		$builder
17
			->add('username', TextType::class, [
18
				'label' => 'Pseudo',
19
				'label_attr' => [
20
					'class' => 'label'
21
				],
22
				'attr' => [],
23
				'required' => true
24
			])
25
			->add('email', EmailType::class, [
26
				'label' => 'E-mail',
27
				'label_attr' => [
28
					'class' => 'label'
29
				],
30
				'attr' => [],
31
				'required' => true
32
			])
33
			->add('submit', SubmitType::class, [
34
				'label' => 'Validate',
35
				'attr' => []
36
			]);
37
		
38
		$builder->add('user', User::class);
39
	}
40
	
41
	public function configureOptions(OptionsResolver $resolver)
42
	{
43
		$resolver->setDefaults([
44
			'data_class' => \PiouPiou\RibsAdminBundle\Entity\Account::class,
45
		]);
46
	}
47
}