Passed
Push — master ( 09dfa8...a6d152 )
by Anthony
02:19
created

Module::configureOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace PiouPiou\RibsAdminBundle\Form;
4
5
use Doctrine\ORM\EntityManagerInterface;
0 ignored issues
show
Bug introduced by
The type Doctrine\ORM\EntityManagerInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
0 ignored issues
show
Bug introduced by
The type Symfony\Bridge\Doctrine\Form\Type\EntityType was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Symfony\Component\Form\AbstractType;
8
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
9
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
10
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
11
use Symfony\Component\Form\Extension\Core\Type\TextType;
12
use Symfony\Component\Form\FormBuilderInterface;
13
use Symfony\Component\OptionsResolver\OptionsResolver;
14
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
15
16
class Module extends AbstractType
17
{
18
	public function buildForm(FormBuilderInterface $builder, array $options)
19
	{
20
		$builder
21
			->add("title", TextType::class, [
22
				"label" => "Name",
23
				"required" => true
24
			])
25
			->add("packageName", TextType::class, [
26
				"label" => "Package name",
27
				"required" => true,
28
                "disabled" => true
29
			])
30
            ->add("titleTag", TextType::class, [
31
                "label" => "Title tag",
32
                "required" => true
33
            ])
34
            ->add("descriptionTag", TextareaType::class, [
35
                "label" => "Description tag",
36
                "required" => true,
37
            ])
38
            ->add("url", TextType::class, [
39
                "label" => "Url",
40
                "required" => true
41
            ])
42
            ->add("urlAdmin", TextType::class, [
43
                "label" => "Admin url",
44
                "required" => true
45
            ])
46
			->add("active", CheckboxType::class, [
47
				"label" => "Enable module",
48
				"attr" => [
49
					"class" => "ribs-checkbox switched cxs-2 no-pl"
50
				],
51
				"required" => false
52
			])
53
            ->add("displayed", CheckboxType::class, [
54
                "label" => "Display module in navigation",
55
                "attr" => [
56
                    "class" => "ribs-checkbox switched cxs-2 no-pl"
57
                ],
58
                "required" => false
59
            ])
60
            ->add('submit', SubmitType::class, [
61
                'label' => 'Validate',
62
                'attr' => []
63
            ]);
64
	}
65
	
66
	public function configureOptions(OptionsResolver $resolver)
67
	{
68
		$resolver->setDefaults([
69
			"data_class" => \PiouPiou\RibsAdminBundle\Entity\Module::class,
70
		]);
71
	}
72
}
73