Completed
Push — master ( 81699d...a5d7cd )
by Julito
31:09
created

CasSettingsSchema::buildSettings()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 13

Duplication

Lines 21
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 13
nc 1
nop 1
dl 21
loc 21
rs 9.3142
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\Entity\Course;
7
use Chamilo\CoreBundle\Entity\Manager\CourseManager;
8
use Chamilo\CoreBundle\Entity\Repository\CourseRepository;
9
use Chamilo\CourseBundle\Tool\BaseTool;
10
use Chamilo\CourseBundle\ToolChain;
11
use Sylius\Bundle\SettingsBundle\Schema\SchemaInterface;
12
use Sylius\Bundle\SettingsBundle\Schema\SettingsBuilderInterface;
13
use Sylius\Bundle\SettingsBundle\Transformer\ObjectToIdentifierTransformer;
14
use Symfony\Component\Form\FormBuilderInterface;
15
use Chamilo\SettingsBundle\Transformer\ArrayToIdentifierTransformer;
16
17
/**
18
 * Class CasSettingsSchema
19
 * @package Chamilo\CoreBundle\Settings
20
 */
21 View Code Duplication
class CasSettingsSchema implements SchemaInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function buildSettings(SettingsBuilderInterface $builder)
27
    {
28
        $builder
29
            ->setDefaults(
30
                array(
31
                    'cas_activate' => '',
32
                    'cas_server' => '',
33
                    'cas_server_uri' => '',
34
                    'cas_port' => '',
35
                    'cas_protocol' => '',
36
                    'cas_add_user_activate' => '',
37
                    'update_user_info_cas_with_ldap' => '',
38
                )
39
            )
40
            ->setAllowedTypes(
41
                array(
42
                )
43
            )
44
        ;
45
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function buildForm(FormBuilderInterface $builder)
52
    {
53
        $builder
54
            ->add('cas_activate', 'yes_no')
55
            ->add('cas_server')
56
            ->add('cas_server_uri')
57
            ->add('cas_port')
58
            ->add('cas_protocol')
59
            ->add('cas_server')
60
            ->add('cas_add_user_activate')
61
            ->add('update_user_info_cas_with_ldap', 'yes_no')
62
        ;
63
    }
64
}
65