vendor/welp/mailchimp-bundle/src/DependencyInjection/Configuration.php line 20

Open in your IDE?
  1. <?php
  2. namespace Welp\MailchimpBundle\DependencyInjection;
  3. use Symfony\Component\Config\Definition\Builder\TreeBuilder;
  4. use Symfony\Component\Config\Definition\ConfigurationInterface;
  5. /**
  6.  * This is the class that validates and merges configuration from your app/config files
  7.  *
  8.  * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class}
  9.  */
  10. class Configuration implements ConfigurationInterface
  11. {
  12.     /**
  13.      * {@inheritDoc}
  14.      */
  15.     public function getConfigTreeBuilder()
  16.     {
  17.         $treeBuilder = new TreeBuilder();
  18.         $rootNode $treeBuilder->root('welp_mailchimp');
  19.         $rootNode
  20.             ->children()
  21.                 ->scalarNode('api_key')
  22.                     ->isRequired()
  23.                 ->end()
  24.                 ->scalarNode('list_provider')
  25.                     ->defaultValue('welp_mailchimp.list_provider')
  26.                 ->end()
  27.                 // lists
  28.                 ->arrayNode('lists')
  29.                     ->useAttributeAsKey('listId')
  30.                     ->prototype('array')
  31.                         ->children()
  32.                             ->scalarNode('subscriber_provider')->end()
  33.                             ->scalarNode('webhook_secret')->end()
  34.                             ->scalarNode('webhook_url')->end()
  35.                             // merge_fields
  36.                             ->arrayNode('merge_fields')
  37.                                 ->prototype('array')
  38.                                     ->children()
  39.                                         ->scalarNode('tag')
  40.                                             ->isRequired()
  41.                                         ->end()
  42.                                         ->scalarNode('name')
  43.                                             ->isRequired()
  44.                                         ->end()
  45.                                         ->scalarNode('type')
  46.                                             ->isRequired()
  47.                                         ->end()
  48.                                         ->booleanNode('required')
  49.                                         ->end()
  50.                                         ->scalarNode('default_value')
  51.                                         ->end()
  52.                                         ->booleanNode('public')
  53.                                         ->end()
  54.                                         ->integerNode('display_order')
  55.                                         ->end()
  56.                                         // tag options
  57.                                         ->arrayNode('options')
  58.                                             ->children()
  59.                                                 ->integerNode('default_country')
  60.                                                 ->end()
  61.                                                 ->scalarNode('phone_format')
  62.                                                 ->end()
  63.                                                 ->scalarNode('date_format')
  64.                                                 ->end()
  65.                                                 ->arrayNode('choices')
  66.                                                     ->prototype('scalar')->end()
  67.                                                 ->end()
  68.                                                 ->integerNode('size')
  69.                                                 ->end()
  70.                                             ->end()
  71.                                         ->end()
  72.                                         ->scalarNode('help_text')
  73.                                         ->end()
  74.                                     ->end()
  75.                                 ->end()
  76.                             ->end()
  77.                         ->end()
  78.                     ->end()
  79.                 ->end()
  80.             ->end()
  81.         ;
  82.         return $treeBuilder;
  83.     }
  84. }