-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathConfiguration.php
More file actions
35 lines (30 loc) · 985 Bytes
/
Configuration.php
File metadata and controls
35 lines (30 loc) · 985 Bytes
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
<?php
namespace Uecode\Bundle\ApiKeyBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('uecode_api_key');
$rootNode
->children()
->scalarNode('delivery')
->defaultValue('query')
->validate()
->ifNotInArray(array('query', 'header'))
->thenInvalid('Unknown authentication delivery type "%s".')
->end()
->end()
->scalarNode('parameter_name')
->defaultValue('api_key')
->end()
->end()
;
return $treeBuilder;
}
}