-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathConfiguration.php
More file actions
89 lines (84 loc) · 3.8 KB
/
Configuration.php
File metadata and controls
89 lines (84 loc) · 3.8 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
namespace Welp\MailchimpBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
/**
* This is the class that validates and merges configuration from your app/config files
*
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritDoc}
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('welp_mailchimp');
$treeBuilder
->getRootNode()
->children()
->scalarNode('api_key')
->isRequired()
->end()
->scalarNode('list_provider')
->defaultValue('welp_mailchimp.list_provider')
->end()
// lists
->arrayNode('lists')
->useAttributeAsKey('listId')
->prototype('array')
->children()
->scalarNode('subscriber_provider')->end()
->scalarNode('webhook_secret')->end()
->scalarNode('webhook_url')->end()
// merge_fields
->arrayNode('merge_fields')
->prototype('array')
->children()
->scalarNode('tag')
->isRequired()
->end()
->scalarNode('name')
->isRequired()
->end()
->scalarNode('type')
->isRequired()
->end()
->booleanNode('required')
->end()
->scalarNode('default_value')
->end()
->booleanNode('public')
->end()
->integerNode('display_order')
->end()
// tag options
->arrayNode('options')
->children()
->integerNode('default_country')
->end()
->scalarNode('phone_format')
->end()
->scalarNode('date_format')
->end()
->arrayNode('choices')
->prototype('scalar')->end()
->end()
->integerNode('size')
->end()
->end()
->end()
->scalarNode('help_text')
->end()
->end()
->end()
->end()
->end()
->end()
->end()
->end()
;
return $treeBuilder;
}
}