Bladeren bron

Configuration tree changes.

Maksim Grib 10 jaren geleden
bovenliggende
commit
7c5b28c931
1 gewijzigde bestanden met toevoegingen van 16 en 13 verwijderingen
  1. 16 13
      DependencyInjection/Configuration.php

+ 16 - 13
DependencyInjection/Configuration.php

@@ -43,7 +43,7 @@ class Configuration implements ConfigurationInterface
                                 ->isRequired()
                                 ->cannotBeEmpty()
                             ->end()
-                            ->scalarNode('active')
+                            ->booleanNode('active')
                                 ->defaultFalse()
                             ->end()
                             ->arrayNode('include')
@@ -60,8 +60,8 @@ class Configuration implements ConfigurationInterface
                     ->defaultValue(array(
                         'localhost' =>  array(
                             'host'  =>  '127.0.0.1',
-                            'port'  =>  "4730",
-                        )
+                            'port'  =>  '4730',
+                        ),
                     ))
                     ->prototype('array')
                         ->children()
@@ -69,8 +69,8 @@ class Configuration implements ConfigurationInterface
                                 ->isRequired()
                                 ->cannotBeEmpty()
                             ->end()
-                            ->scalarNode('port')
-                                ->defaultValue("4730")
+                            ->integerNode('port')
+                                ->defaultValue('4730')
                             ->end()
                         ->end()
                     ->end()
@@ -78,29 +78,32 @@ class Configuration implements ConfigurationInterface
                 ->arrayNode('defaults')
                     ->addDefaultsIfNotSet()
                     ->children()
-                        ->scalarNode('iterations')
+                        ->integerNode('iterations')
+                            ->min(0)
                             ->defaultValue(0)
                         ->end()
                         ->scalarNode('method')
                             ->defaultValue('doNormal')
                         ->end()
-                        ->scalarNode('callbacks')
+                        ->booleanNode('callbacks')
                             ->defaultTrue()
                         ->end()
                         ->scalarNode('job_prefix')
                             ->defaultNull()
                         ->end()
-                        ->scalarNode('generate_unique_key')
+                        ->booleanNode('generate_unique_key')
                             ->defaultTrue()
                         ->end()
-                        ->scalarNode('workers_name_prepend_namespace')
+                        ->booleanNode('workers_name_prepend_namespace')
                             ->defaultTrue()
                         ->end()
-                        ->scalarNode('minimum_execution_time')
-                            ->defaultNull()
+                        ->integerNode('minimum_execution_time')
+                            ->min(0)
+                            ->defaultValue(0)
                         ->end()
-                        ->scalarNode('timeout')
-                            ->defaultNull()
+                        ->integerNode('timeout')
+                            ->min(0)
+                            ->defaultValue(0)
                         ->end()
                     ->end()
                 ->end()