Passed
Push — master ( f801c1...492dcf )
by Julito
10:30 queued 10s
created

LearningPathSettingsSchema::buildForm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
/* For licensing terms, see /license.txt */
3
4
namespace Chamilo\CoreBundle\Settings;
5
6
use Chamilo\CoreBundle\Form\Type\YesNoType;
7
use Sylius\Bundle\SettingsBundle\Schema\SettingsBuilderInterface;
8
use Symfony\Component\Form\FormBuilderInterface;
9
10
/**
11
 * Class LearningPathSettingsSchema.
12
 *
13
 * @package Chamilo\CoreBundle\Settings
14
 */
15
class LearningPathSettingsSchema extends AbstractSettingsSchema
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function buildSettings(SettingsBuilderInterface $builder)
21
    {
22
        $builder
23
            ->setDefaults(
24
                [
25
                    'fixed_encoding' => 'false',
26
                    'show_invisible_exercise_in_lp_toc' => 'false'
27
                ]
28
            );
29
30
        $allowedTypes = [
31
            'fixed_encoding' => ['string'],
32
        ];
33
        $this->setMultipleAllowedTypes($allowedTypes, $builder);
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function buildForm(FormBuilderInterface $builder)
40
    {
41
        $builder
42
            ->add('fixed_encoding', YesNoType::class)
43
            ->add('show_invisible_exercise_in_lp_toc', YesNoType::class)
44
        ;
45
    }
46
}
47