Refactored the declaration of services for ServiceBinder

This commit is contained in:
Francis Besset
2011-08-14 21:06:04 +02:00
parent d3a8965500
commit 33165ce8d2
3 changed files with 12 additions and 21 deletions

View File

@ -27,8 +27,6 @@ use Symfony\Component\Config\Loader\LoaderInterface;
*/
class WebServiceContext
{
private $requestMessageBinder;
private $responseMessageBinder;
private $typeRepository;
private $converterRepository;
@ -40,13 +38,10 @@ class WebServiceContext
private $serviceBinder;
private $serverFactory;
public function __construct(LoaderInterface $loader, DumperInterface $dumper, MessageBinderInterface $requestMessageBinder, MessageBinderInterface $responseMessageBinder, TypeRepository $typeRepository, ConverterRepository $converterRepository, array $options) {
public function __construct(LoaderInterface $loader, DumperInterface $dumper, TypeRepository $typeRepository, ConverterRepository $converterRepository, array $options) {
$this->loader = $loader;
$this->wsdlFileDumper = $dumper;
$this->requestMessageBinder = $requestMessageBinder;
$this->responseMessageBinder = $responseMessageBinder;
$this->typeRepository = $typeRepository;
$this->converterRepository = $converterRepository;
@ -90,7 +85,11 @@ class WebServiceContext
public function getServiceBinder()
{
if (null === $this->serviceBinder) {
$this->serviceBinder = new ServiceBinder($this->getServiceDefinition(), $this->requestMessageBinder, $this->responseMessageBinder);
$this->serviceBinder = new ServiceBinder(
$this->getServiceDefinition(),
new $this->options['binder_request_class'](),
new $this->options['binder_response_class']()
);
}
return $this->serviceBinder;