StaticContentChoiceType::configureOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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