[SoapBundle] Fixed Configuration.php

This commit is contained in:
Francis Besset 2013-07-22 11:52:32 +02:00
parent 2e99bb7e17
commit e4a9b70fb3
1 changed files with 42 additions and 44 deletions

View File

@ -49,16 +49,17 @@ class Configuration
->children() ->children()
->arrayNode('cache') ->arrayNode('cache')
->addDefaultsIfNotSet() ->addDefaultsIfNotSet()
->children() ->children()
->scalarNode('type') ->scalarNode('type')
->defaultValue('disk') ->defaultValue('disk')
->validate() ->validate()
->ifNotInArray($this->cacheTypes) ->ifNotInArray($this->cacheTypes)
->thenInvalid(sprintf('The cache type has to be either %s', implode(', ', $this->cacheTypes))) ->thenInvalid(sprintf('The cache type has to be either %s', implode(', ', $this->cacheTypes)))
->end()
->end() ->end()
->scalarNode('lifetime')->defaultNull()->end()
->scalarNode('limit')->defaultNull()->end()
->end() ->end()
->scalarNode('lifetime')->defaultNull()->end()
->scalarNode('limit')->defaultNull()->end()
->end() ->end()
->end() ->end()
->end() ->end()
@ -71,20 +72,21 @@ class Configuration
->children() ->children()
->arrayNode('clients') ->arrayNode('clients')
->useAttributeAsKey('name') ->useAttributeAsKey('name')
->prototype('array') ->prototype('array')
->children() ->children()
->scalarNode('wsdl')->isRequired()->end() ->scalarNode('wsdl')->isRequired()->end()
->scalarNode('user_agent')->end() ->scalarNode('user_agent')->end()
->scalarNode('cache_type') ->scalarNode('cache_type')
->validate() ->validate()
->ifNotInArray($this->cacheTypes) ->ifNotInArray($this->cacheTypes)
->thenInvalid(sprintf('The cache type has to be either %s', implode(', ', $this->cacheTypes))) ->thenInvalid(sprintf('The cache type has to be either %s', implode(', ', $this->cacheTypes)))
->end()
->end()
->arrayNode('classmap')
->useAttributeAsKey('name')->prototype('scalar')->end()
->end()
->end() ->end()
->end() ->end()
->arrayNode('classmap')
->useAttributeAsKey('name')
->prototype('scalar')
->end()
->end() ->end()
->end() ->end()
->end() ->end()
@ -97,28 +99,23 @@ class Configuration
->children() ->children()
->arrayNode('services') ->arrayNode('services')
->useAttributeAsKey('name') ->useAttributeAsKey('name')
->prototype('array') ->prototype('array')
->children() ->children()
->scalarNode('namespace') ->scalarNode('namespace')->isRequired()->end()
->isRequired() ->scalarNode('resource')->defaultValue('*')->end()
->end() ->scalarNode('resource_type')->defaultValue('annotation')->end()
->scalarNode('resource') ->scalarNode('binding')
->defaultValue('*') ->defaultValue('document-wrapped')
->end() ->validate()
->scalarNode('resource_type') ->ifNotInArray(array('rpc-literal', 'document-wrapped'))
->defaultValue('annotation') ->thenInvalid("Service binding style has to be either 'rpc-literal' or 'document-wrapped'")
->end() ->end()
->scalarNode('binding')
->defaultValue('document-wrapped')
->validate()
->ifNotInArray(array('rpc-literal', 'document-wrapped'))
->thenInvalid("Service binding style has to be either 'rpc-literal' or 'document-wrapped'")
->end() ->end()
->end() ->scalarNode('cache_type')
->scalarNode('cache_type') ->validate()
->validate() ->ifNotInArray($this->cacheTypes)
->ifNotInArray($this->cacheTypes) ->thenInvalid(sprintf('The cache type has to be either %s', implode(', ', $this->cacheTypes)))
->thenInvalid(sprintf('The cache type has to be either %s', implode(', ', $this->cacheTypes))) ->end()
->end() ->end()
->end() ->end()
->end() ->end()
@ -133,8 +130,9 @@ class Configuration
->children() ->children()
->arrayNode('wsdl_dumper') ->arrayNode('wsdl_dumper')
->addDefaultsIfNotSet() ->addDefaultsIfNotSet()
->children() ->children()
->scalarNode('stylesheet')->defaultNull() ->scalarNode('stylesheet')->defaultNull()->end()
->end()
->end() ->end()
->end() ->end()
->end() ->end()