Completed
Pull Request — master (#4433)
by Craig
04:45
created

Configuration   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 22
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 26 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Zikula package.
7
 *
8
 * Copyright Zikula - https://ziku.la/
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Zikula\SecurityCenterModule\DependencyInjection;
15
16
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
17
use Symfony\Component\Config\Definition\ConfigurationInterface;
18
19
class Configuration implements ConfigurationInterface
20
{
21
    public function getConfigTreeBuilder()
22
    {
23
        $treeBuilder = new TreeBuilder('zikula_security_center');
24
25
        $treeBuilder->getRootNode()
26
            ->children()
27
                ->enumNode('x_frame_options')
28
                    ->values(['SAMEORIGIN', 'DENY'])
29
                    ->defaultValue('SAMEORIGIN')
30
                ->end()
31
                ->arrayNode('session')
32
                    ->addDefaultsIfNotSet()
33
                    ->children()
34
                        ->scalarNode('name')->defaultValue('_zsid')->end()
35
                        ->scalarNode('handler_id')->defaultValue('session.handler.native_file')->end()
36
                        ->scalarNode('storage_id')->defaultValue('zikula_core.bridge.http_foundation.zikula_session_storage_file')->end()
37
                        ->scalarNode('save_path')->defaultValue('%kernel.cache_dir%/sessions')->end()
38
                        ->enumNode('cookie_secure')
39
                            ->values([true, false, 'auto'])
40
                            ->defaultValue('auto')
41
                        ->end()
42
                    ->end()
43
            ->end()
44
        ;
45
46
        return $treeBuilder;
47
    }
48
}
49