RouteType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 13 1
A getBlockPrefix() 0 4 1
1
<?php
2
3
namespace Lakion\CmsPlugin\Form\Type;
4
5
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
6
use Symfony\Component\Form\Extension\Core\Type\TextType;
7
use Symfony\Component\Form\FormBuilderInterface;
8
9
final class RouteType extends AbstractResourceType
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function buildForm(FormBuilderInterface $builder, array $options = [])
15
    {
16
        $builder
17
            ->add('name', TextType::class, [
18
                'label' => 'lakion_cms.form.route.name',
19
            ])
20
            ->add('content', StaticContentChoiceType::class, [
21
                'label' => 'lakion_cms.form.route.content',
22
                'choice_label' => 'title',
23
                'choice_translation_domain' => false,
24
            ])
25
        ;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function getBlockPrefix()
32
    {
33
        return 'lakion_cms_route';
34
    }
35
}
36