]> Raphaƫl G. Git Repositories - airbundle/blobdiff - DependencyInjection/Configuration.php
Move configuration under rapsys_air key
[airbundle] / DependencyInjection / Configuration.php
index 13d24a7afe297048de5ecc4efc53840d280c0532..3c664679dc56eac3746d51d886e01ec34ecf40c4 100644 (file)
@@ -15,7 +15,7 @@ class Configuration implements ConfigurationInterface {
      * {@inheritdoc}
      */
     public function getConfigTreeBuilder() {
-        $treeBuilder = new TreeBuilder();
+        $treeBuilder = new TreeBuilder('rapsys_air');
 
         // Here you should define the parameters that are allowed to
         // configure your bundle. See the documentation linked above for
@@ -36,18 +36,13 @@ class Configuration implements ConfigurationInterface {
                //Here we define the parameters that are allowed to configure the bundle.
                $treeBuilder
                        //Parameters
-                       ->root('parameters')
+                       ->getRootNode()
                                ->addDefaultsIfNotSet()
                                ->children()
-                                       ->arrayNode('rapsys_air')
-                                               ->addDefaultsIfNotSet()
-                                               ->children()
-                                                       ->scalarNode('logo')->defaultValue($defaults['logo'])->treatNullLike($defaults['logo'])->isRequired()->end()
-                                                       ->scalarNode('title')->defaultValue($defaults['title'])->treatNullLike($defaults['title'])->isRequired()->end()
-                                                       ->scalarNode('contact_name')->defaultValue($defaults['contact_name'])->treatNullLike($defaults['contact_name'])->isRequired()->end()
-                                                       ->scalarNode('contact_mail')->defaultValue($defaults['contact_mail'])->treatNullLike($defaults['contact_mail'])->isRequired()->end()
-                                               ->end()
-                                       ->end()
+                                       ->scalarNode('logo')->defaultValue($defaults['logo'])->treatNullLike($defaults['logo'])->cannotBeEmpty()->end()
+                                       ->scalarNode('title')->defaultValue($defaults['title'])->treatNullLike($defaults['title'])->cannotBeEmpty()->end()
+                                       ->scalarNode('contact_name')->defaultValue($defaults['contact_name'])->treatNullLike($defaults['contact_name'])->cannotBeEmpty()->end()
+                                       ->scalarNode('contact_mail')->defaultValue($defaults['contact_mail'])->treatNullLike($defaults['contact_mail'])->cannotBeEmpty()->end()
                                ->end()
                        ->end();