BookmarkType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 8 1
A configureOptions() 0 5 1
1
<?php
2
3
namespace App\Form;
4
5
use App\Entity\Bookmark;
6
use Symfony\Component\Form\AbstractType;
7
use Symfony\Component\Form\Extension\Core\Type\NumberType;
8
use Symfony\Component\Form\Extension\Core\Type\TextType;
9
use Symfony\Component\Form\FormBuilderInterface;
10
use Symfony\Component\OptionsResolver\OptionsResolver;
11
12
class BookmarkType extends AbstractType
13
{
14
    public function buildForm(FormBuilderInterface $builder, array $options): void
15
    {
16
        $builder
17
            ->add('title', TextType::class, [
18
                'required' => true,
19
            ])
20
            ->add('timeInSeconds', NumberType::class, [
21
                'required' => true,
22
            ])
23
        ;
24
    }
25
26
    public function configureOptions(OptionsResolver $resolver): void
27
    {
28
        $resolver->setDefaults([
29
            'data_class' => Bookmark::class,
30
            'csrf_protection' => false,
31
        ]);
32
    }
33
}
34