Passed
Push — master ( 655177...3296ef )
by Anthony
11:29
created

Version   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 19
c 1
b 0
f 0
dl 0
loc 38
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 22 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 Version 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("projectName", TextType::class, [
21
				"label" => "Project name",
22
				"required" => true
23
			])
24
			->add("projectUrl", TextType::class, [
25
				"label" => "Project url",
26
				"required" => true
27
			])
28
            ->add("packageName", TextType::class, [
29
                "label" => "Package name",
30
                "required" => true
31
            ])
32
            ->add("checkVersionUrl", TextType::class, [
33
                "label" => "Check version url",
34
                "required" => true
35
            ])
36
            ->add('submit', SubmitType::class, [
37
                'label' => 'Validate',
38
                'attr' => []
39
            ]);
40
	}
41
42
    /**
43
     * @param OptionsResolver $resolver
44
     */
45
	public function configureOptions(OptionsResolver $resolver)
46
	{
47
		$resolver->setDefaults([
48
			"data_class" => \PiouPiou\RibsAdminBundle\Entity\Version::class,
49
		]);
50
	}
51
}
52