Completed
Push — master ( b453a3...b1e9d6 )
by Ruud
40:05 queued 27:14
created

TextPagePartAdminType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 32
ccs 8
cts 10
cp 0.8
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getBlockPrefix() 0 4 1
A configureOptions() 0 6 1
A buildForm() 0 7 1
1
<?php
2
3
namespace Kunstmaan\PagePartBundle\Form;
4
5
use Kunstmaan\AdminBundle\Form\WysiwygType;
6
use Symfony\Component\Form\AbstractType;
7
use Symfony\Component\Form\FormBuilderInterface;
8
use Symfony\Component\OptionsResolver\OptionsResolver;
9
10
/**
11
 * TextPagePartAdminType
12
 */
13
class TextPagePartAdminType extends AbstractType
14
{
15
    /**
16
     * @param \Symfony\Component\Form\FormBuilderInterface $builder
17
     * @param array                                        $options
18
     */
19 1
    public function buildForm(FormBuilderInterface $builder, array $options)
20
    {
21 1
        $builder->add('content', WysiwygType::class, array(
22 1
            'label' => 'pagepart.text.content',
23
            'required' => false,
24
        ));
25 1
    }
26
27
    /**
28
     * @return string
29
     */
30
    public function getBlockPrefix()
31
    {
32
        return 'kunstmaan_pagepartbundle_textpageparttype';
33
    }
34
35
    /**
36
     * @param \Symfony\Component\OptionsResolver\OptionsResolver $resolver
37
     */
38 1
    public function configureOptions(OptionsResolver $resolver)
39
    {
40 1
        $resolver->setDefaults(array(
41 1
            'data_class' => 'Kunstmaan\PagePartBundle\Entity\TextPagePart',
42
        ));
43 1
    }
44
}
45