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

CertificateSettingsSchema   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildSettings() 0 14 1
A buildForm() 0 5 1
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 CertificateSettingsSchema.
12
 *
13
 * @package Chamilo\CoreBundle\Settings
14
 */
15
class CertificateSettingsSchema extends AbstractSettingsSchema
16
{
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function buildSettings(SettingsBuilderInterface $builder)
21
    {
22
        $builder
23
            ->setDefaults(
24
                [
25
                    'hide_my_certificate_link' => 'false',
26
                    'hide_header_footer' => 'false'
27
                ]
28
            );
29
30
        $allowedTypes = [
31
            'hide_my_certificate_link' => ['string'],
32
        ];
33
        $this->setMultipleAllowedTypes($allowedTypes, $builder);
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function buildForm(FormBuilderInterface $builder)
40
    {
41
        $builder
42
            ->add('hide_my_certificate_link', YesNoType::class)
43
            ->add('hide_header_footer', YesNoType::class)
44
        ;
45
    }
46
}
47