Completed
Push — master ( 8f4f35...a1b004 )
by Jeroen
20s queued 11s
created

WysiwygType::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Kunstmaan\AdminBundle\Form;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\DataTransformerInterface;
7
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
8
use Symfony\Component\Form\FormBuilderInterface;
9
10
/**
11
 * Class WysiwygType
12
 */
13
class WysiwygType extends AbstractType
14
{
15
    /**
16
     * @var DataTransformerInterface
17
     */
18 1
    private $mediaTokenTransformer;
19
20 1
    public function __construct(DataTransformerInterface $mediaTokenTransformer)
21 1
    {
22 1
        $this->mediaTokenTransformer = $mediaTokenTransformer;
23
    }
24
25
    /**
26
     * @param FormBuilderInterface $builder
27 1
     * @param array                $options
28
     */
29 1
    public function buildForm(FormBuilderInterface $builder, array $options)
30
    {
31
        $builder->addModelTransformer($this->mediaTokenTransformer);
32
    }
33
34
    /**
35 1
     * @return string
36
     */
37 1
    public function getParent()
38
    {
39
        return TextareaType::class;
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getBlockPrefix()
46
    {
47
        return 'wysiwyg';
48
    }
49
}
50