AccessRight   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 11
c 2
b 0
f 0
dl 0
loc 27
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 11 1
A configureOptions() 0 4 1
1
<?php
2
3
namespace PiouPiou\RibsAdminBundle\Form;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
7
use Symfony\Component\Form\Extension\Core\Type\TextType;
8
use Symfony\Component\Form\FormBuilderInterface;
9
use Symfony\Component\OptionsResolver\OptionsResolver;
10
11
class AccessRight extends AbstractType
12
{
13
    /**
14
     * @param FormBuilderInterface $builder
15
     * @param array $options
16
     */
17
	public function buildForm(FormBuilderInterface $builder, array $options)
18
	{
19
		$builder
20
			->add('name', TextType::class, [
21
				'label' => 'Name of the list',
22
				'attr' => [],
23
				'required' => true
24
			])
25
			->add('submit', SubmitType::class, [
26
				'label' => 'Validate',
27
				'attr' => []
28
			]);
29
	}
30
31
    /**
32
     * @param OptionsResolver $resolver
33
     */
34
	public function configureOptions(OptionsResolver $resolver)
35
	{
36
		$resolver->setDefaults([
37
			'data_class' => \PiouPiou\RibsAdminBundle\Entity\AccessRight::class,
38
		]);
39
	}
40
}
41