Deleted "name" element in the configuration of services

This commit is contained in:
Francis Besset 2011-07-14 18:39:47 +02:00
parent 581ebaf865
commit 81118f8d47
3 changed files with 6 additions and 9 deletions

View File

@ -33,11 +33,9 @@ class Configuration
$rootNode
->children()
->arrayNode('services')
->useAttributeAsKey('name')
->prototype('array')
->children()
->scalarNode('name')
->isRequired()
->end()
->scalarNode('namespace')
->isRequired()
->end()

View File

@ -44,12 +44,12 @@ class WebServiceExtension extends Extension
$config = $processor->process($configuration->getConfigTree(), $configs);
foreach($config['services'] as $serviceContextConfig) {
$this->createWebServiceContext($serviceContextConfig, $container);
foreach($config['services'] as $name => $serviceConfig) {
$this->createWebServiceContext($name, $serviceConfig, $container);
}
}
private function createWebServiceContext(array $config, ContainerBuilder $container)
private function createWebServiceContext($name, array $config, ContainerBuilder $container)
{
$bindingDependentArguments = array(1, 3, 4);
$bindingSuffix = $this->bindingConfigToServiceSuffixMap[$config['binding']];
@ -58,7 +58,7 @@ class WebServiceExtension extends Extension
$contextPrototype = $container->getDefinition('webservice.context');
$contextPrototypeArguments = $contextPrototype->getArguments();
$contextId = 'webservice.context.'.$config['name'];
$contextId = 'webservice.context.'.$name;
$context = $container->setDefinition($contextId, new DefinitionDecorator('webservice.context'));
$arguments = array();

View File

@ -26,8 +26,7 @@ QuickStart
web_service:
services:
demoapi:
name: DemoApi
DemoApi:
namespace: http://mysymfonyapp.com/ws/DemoApi/1.0/
binding: rpc-literal
resource: "@AcmeDemoBundle/Controller/DemoController.php"