forked from eko/FeedBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Configuration.php
55 lines (50 loc) · 1.65 KB
/
Configuration.php
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
<?php
/*
* This file is part of the Eko\FeedBundle Symfony bundle.
*
* (c) Vincent Composieux <vincent.composieux@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Eko\FeedBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* Configuration
*
* This class generates configuration settings tree
*
* @author Vincent Composieux <vincent.composieux@gmail.com>
*/
class Configuration implements ConfigurationInterface
{
/**
* Builds configuration tree
*
* @return \Symfony\Component\Config\Definition\Builder\TreeBuilder A tree builder instance
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('eko_feed');
$rootNode
->children()
->arrayNode('feeds')
->requiresAtLeastOneElement()
->useAttributeAsKey('name')
->prototype('array')
->children()
->scalarNode('title')->isRequired()->end()
->scalarNode('description')->isRequired()->end()
->scalarNode('link')->isRequired()->end()
->scalarNode('encoding')->isRequired()->end()
->scalarNode('author')->end()
->end()
->end()
->end()
->end()
;
return $treeBuilder;
}
}