Created a client classmap even when it is empty

This commit is contained in:
Francis Besset 2014-04-30 10:54:07 +02:00
parent 59ea6b1ce0
commit e4cb612aed
1 changed files with 7 additions and 9 deletions

View File

@ -104,12 +104,8 @@ class BeSimpleSoapExtension extends Extension
$definition->replaceArgument(1, $defOptions); $definition->replaceArgument(1, $defOptions);
if (!empty($options['classmap'])) { $classmap = $this->createClientClassmap($client, $options['classmap'], $container);
$classmap = $this->createClientClassmap($client, $options['classmap'], $container); $definition->replaceArgument(2, new Reference($classmap));
$definition->replaceArgument(2, new Reference($classmap));
} else {
$definition->replaceArgument(2, null);
}
$this->createClient($client, $container); $this->createClient($client, $container);
} }
@ -120,9 +116,11 @@ class BeSimpleSoapExtension extends Extension
$definition = new DefinitionDecorator('besimple.soap.classmap'); $definition = new DefinitionDecorator('besimple.soap.classmap');
$container->setDefinition(sprintf('besimple.soap.classmap.%s', $client), $definition); $container->setDefinition(sprintf('besimple.soap.classmap.%s', $client), $definition);
$definition->setMethodCalls(array( if (!empty($classmap)) {
array('set', array($classmap)), $definition->setMethodCalls(array(
)); array('set', array($classmap)),
));
}
return sprintf('besimple.soap.classmap.%s', $client); return sprintf('besimple.soap.classmap.%s', $client);
} }