Configuration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 71
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 65
dl 0
loc 71
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
B getConfigTreeBuilder() 0 69 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\CoreBundle\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(): TreeBuilder
22
    {
23
        $treeBuilder = new TreeBuilder('core');
24
25
        $treeBuilder->getRootNode()
26
            ->children()
27
                ->scalarNode('datadir')
28
                    ->info('Directory for data files which might be added or uploaded.')
29
                    ->defaultValue('public/uploads')
30
                ->end()
31
                ->enumNode('x_frame_options')
0 ignored issues
show
Bug introduced by
The method enumNode() does not exist on Symfony\Component\Config...der\NodeParentInterface. It seems like you code against a sub-type of Symfony\Component\Config...der\NodeParentInterface such as Symfony\Component\Config...ion\Builder\NodeBuilder. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

31
                ->/** @scrutinizer ignore-call */ enumNode('x_frame_options')
Loading history...
32
                    ->info('X-Frame-Options value.')
33
                    ->values(['SAMEORIGIN', 'DENY'])
34
                    ->defaultValue('SAMEORIGIN')
35
                ->end()
36
                ->arrayNode('maintenance_mode')
37
                    ->info('Disable site for maintenance.')
38
                    ->canBeEnabled()
39
                    ->children()
40
                        ->scalarNode('reason')
41
                            ->info('Reason for disabling site.')
42
                            ->defaultNull()
43
                        ->end()
44
                    ->end()
45
                ->end()
46
                ->booleanNode('enable_mail_logging')
47
                    ->info('Whether mail logging should be used or not.')
48
                    ->defaultFalse()
49
                ->end()
50
                ->booleanNode('multilingual')
51
                    ->info('Activate multilingual features.')
52
                    ->defaultTrue()
53
                ->end()
54
                ->arrayNode('site_data')
55
                    ->info('Main site information (if desired per locale).')
56
                    ->useAttributeAsKey('locale')
57
                    ->arrayPrototype()
58
                        ->children()
59
                            ->scalarNode('locale')
60
                                ->info('Locale code.')
61
                                ->defaultValue('en')
62
                            ->end()
63
                            ->scalarNode('sitename')
64
                                ->info('Site name.')
65
                                ->defaultValue('My site')
66
                            ->end()
67
                            ->scalarNode('slogan')
68
                                ->info('Site description.')
69
                                ->defaultValue('This is my site.')
70
                            ->end()
71
                            ->scalarNode('page_title_scheme')
72
                                ->info('Page title scheme. Possible tags: #pagetitle#, #sitename#.')
73
                                ->defaultValue('#pagetitle# - #sitename#')
74
                            ->end()
75
                            ->scalarNode('meta_description')
76
                                ->info('Meta description.')
77
                                ->defaultValue('This is my site description.')
78
                            ->end()
79
                            ->scalarNode('admin_mail')
80
                                ->info('Admin mail address.')
81
                                ->defaultNull()
82
                            ->end()
83
                        ->end()
84
                    ->end()
85
                ->end()
86
            ->end()
87
        ;
88
89
        return $treeBuilder;
90
    }
91
}
92