From a6f8ccbfd28163e5e830f55c8a2319f7ad15329c Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Thu, 11 Aug 2011 23:55:46 +0200 Subject: [PATCH] Cleaned code --- Controller/SoapWebServiceController.php | 6 +----- ServiceBinding/ServiceBinder.php | 9 ++++----- Soap/SoapRequest.php | 15 ++++++++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Controller/SoapWebServiceController.php b/Controller/SoapWebServiceController.php index 2a697b8..e2dbd53 100644 --- a/Controller/SoapWebServiceController.php +++ b/Controller/SoapWebServiceController.php @@ -101,11 +101,7 @@ class SoapWebServiceController extends ContainerAware $this->soapRequest->getSoapHeaders()->add( $this->serviceBinder->processServiceHeader($method, $arguments[0]) ); - - return; - } - - if ($this->serviceBinder->isServiceMethod($method)) { + } elseif ($this->serviceBinder->isServiceMethod($method)) { $this->soapRequest->attributes->add( $this->serviceBinder->processServiceMethodArguments($method, $arguments) ); diff --git a/ServiceBinding/ServiceBinder.php b/ServiceBinding/ServiceBinder.php index 57065e6..e359c55 100644 --- a/ServiceBinding/ServiceBinder.php +++ b/ServiceBinding/ServiceBinder.php @@ -62,11 +62,10 @@ class ServiceBinder { $methodDefinition = $this->definition->getMethods()->get($name); - $result = array(); - $result['_controller'] = $methodDefinition->getController(); - $result = array_merge($result, $this->requestMessageBinder->processMessage($methodDefinition, $arguments, $this->definition->getDefinitionComplexTypes())); - - return $result; + return array_merge( + array('_controller' => $methodDefinition->getController()), + $this->requestMessageBinder->processMessage($methodDefinition, $arguments, $this->definition->getDefinitionComplexTypes()) + ); } public function processServiceMethodReturnValue($name, $return) diff --git a/Soap/SoapRequest.php b/Soap/SoapRequest.php index 6cc0f97..0b20161 100644 --- a/Soap/SoapRequest.php +++ b/Soap/SoapRequest.php @@ -24,11 +24,6 @@ use Zend\Mime\Message; */ class SoapRequest extends Request { - public static function createFromHttpRequest(Request $request) - { - return new static($request->query->all(), $request->request->all(), $request->attributes->all(), $request->cookies->all(), $request->files->all(), $request->server->all(), $request->content); - } - /** * @var string */ @@ -49,6 +44,16 @@ class SoapRequest extends Request */ protected $soapAttachments; + /** + * @param \Symfony\Component\HttpFoundation\Request $request + * + * @return SoapRequest + */ + public static function createFromHttpRequest(Request $request) + { + return new static($request->query->all(), $request->request->all(), $request->attributes->all(), $request->cookies->all(), $request->files->all(), $request->server->all(), $request->content); + } + public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null) { parent::initialize($query, $request, $attributes, $cookies, $files, $server, $content);