vendor/rawafed/contact-forms-bundle/DependencyInjection/Configuration.php line 21

Open in your IDE?
  1. <?php
  2. namespace Rawafed\ContactFormsBundle\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('contact_forms');
  19.         $rootNode
  20.             ->children()
  21.                 ->booleanNode('enable_recaptcha')->defaultFalse()->end()
  22.                 ->arrayNode('attachments')
  23.                     ->addDefaultsIfNotSet()
  24.                     ->children()
  25.                         ->booleanNode('enabled')->defaultFalse()->end()
  26.                         ->booleanNode('multiple')->defaultFalse()->end()
  27.                         ->scalarNode('max_size')->defaultValue('2M')->end()
  28.                         ->arrayNode('mime_types')
  29.                             ->defaultValue([
  30.                                 'application/pdf',
  31.                                 'application/x-pdf',
  32.                                 'application/msword',
  33.                                 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
  34.                                 'application/vnd.ms-excel',
  35.                                 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
  36.                                 'application/vnd.ms-powerpoint',
  37.                                 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
  38.                                 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
  39.                             ])
  40.                             ->useAttributeAsKey('name')
  41.                             ->prototype('scalar')
  42.                             ->end()
  43.                         ->end()
  44.                     ->end()
  45.                 ->end()
  46.             ->end()
  47.         ;
  48.         // Here you should define the parameters that are allowed to
  49.         // configure your bundle. See the documentation linked above for
  50.         // more information on that topic.
  51.         return $treeBuilder;
  52.     }
  53. }