This repository was archived by the owner on Jan 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathConfiguration.php
More file actions
67 lines (63 loc) · 2.46 KB
/
Copy pathConfiguration.php
File metadata and controls
67 lines (63 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
/*
* This file is part of the KleijnWeb\SwaggerBundle package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace KleijnWeb\SwaggerBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* @author John Kleijn <john@kleijnweb.nl>
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('swagger');
$rootNode = \method_exists(TreeBuilder::class, 'getRootNode') ? $treeBuilder->getRootNode() : $treeBuilder->root('swagger');
$rootNode
->children()
->booleanNode('disable_error_listener')->defaultFalse()->end()
->arrayNode('serializer')
->addDefaultsIfNotSet()
->children()
->enumNode('type')
->values(array('array', 'jms', 'symfony'))
->defaultValue('array')
->cannotBeEmpty()
->end()
->arrayNode('namespace')
->beforeNormalization()
->ifString()
->then(function ($v) { return [$v]; })
->end()
->prototype('scalar')
->end()
->end()
->end()
->end()
->arrayNode('document')
->addDefaultsIfNotSet()
->children()
->scalarNode('cache')->isRequired()->defaultFalse()->end()
->scalarNode('base_path')->defaultValue('')->end()
->arrayNode('public')
->addDefaultsIfNotSet()
->children()
->scalarNode('scheme')->defaultNull()->end()
->scalarNode('base_url')->defaultValue('/')->end()
->scalarNode('host')->defaultNull()->end()
->end()
->end()
->end()
->end()
->end()
;
return $treeBuilder;
}
}