StaticContentChoiceType   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 39
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A configureOptions() 0 4 1
A getParent() 0 4 1
A getBlockPrefix() 0 4 1
1
<?php
2
3
namespace Lakion\CmsPlugin\Form\Type;
4
5
use Doctrine\Bundle\PHPCRBundle\Form\Type\DocumentType;
6
use Symfony\Component\Form\AbstractType;
7
use Symfony\Component\OptionsResolver\OptionsResolver;
8
9
final class StaticContentChoiceType extends AbstractType
10
{
11
    /**
12
     * @var string
13
     */
14
    private $dataClass;
15
16
    /**
17
     * @param string $dataClass
18
     */
19
    public function __construct($dataClass)
20
    {
21
        $this->dataClass = $dataClass;
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function configureOptions(OptionsResolver $resolver)
28
    {
29
        $resolver->setDefault('class', $this->dataClass);
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function getParent()
36
    {
37
        return DocumentType::class;
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getBlockPrefix()
44
    {
45
        return 'lakion_cms_static_content_choice';
46
    }
47
}
48