Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into hotfix/translator-caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 26 deletions.
16 changes: 10 additions & 6 deletions src/AutoDiscover.php
Expand Up @@ -106,6 +106,7 @@ class AutoDiscover
* @param ComplexTypeStrategy $strategy
* @param string|Uri\Uri $endpointUri
* @param string $wsdlClass
* @param array $classMap
*/
public function __construct(ComplexTypeStrategy $strategy = null, $endpointUri=null, $wsdlClass=null, array $classMap = array())
{
Expand Down Expand Up @@ -343,7 +344,7 @@ public function addFunction($function)
/**
* Generate the WSDL for a service class.
*
* @return Zend\Soap\Wsdl
* @return Wsdl
*/
protected function _generateClass()
{
Expand All @@ -353,7 +354,7 @@ protected function _generateClass()
/**
* Generate the WSDL for a set of functions.
*
* @return Zend\Soap\Wsdl
* @return Wsdl
*/
protected function _generateFunctions()
{
Expand All @@ -368,7 +369,8 @@ protected function _generateFunctions()
/**
* Generate the WSDL for a set of reflection method instances.
*
* @return Zend\Soap\Wsdl
* @param array $reflectionMethods
* @return Wsdl
*/
protected function _generateWsdl(array $reflectionMethods)
{
Expand All @@ -381,7 +383,7 @@ protected function _generateWsdl(array $reflectionMethods)
$wsdl->addSchemaTypeSection();

$port = $wsdl->addPortType($serviceName . 'Port');
$binding = $wsdl->addBinding($serviceName . 'Binding', 'tns:' .$serviceName. 'Port');
$binding = $wsdl->addBinding($serviceName . 'Binding', 'tns:' . $serviceName . 'Port');

$wsdl->addSoapBinding($binding, $this->bindingStyle['style'], $this->bindingStyle['transport']);
$wsdl->addService($serviceName . 'Service', $serviceName . 'Port', 'tns:' . $serviceName . 'Binding', $uri);
Expand All @@ -400,6 +402,7 @@ protected function _generateWsdl(array $reflectionMethods)
* @param $wsdl \Zend\Soap\Wsdl WSDL document
* @param $port object wsdl:portType
* @param $binding object wsdl:binding
* @throws Exception\InvalidArgumentException
* @return void
*/
protected function _addFunctionToWsdl($function, $wsdl, $port, $binding)
Expand Down Expand Up @@ -492,7 +495,7 @@ protected function _addFunctionToWsdl($function, $wsdl, $port, $binding)
// When using the RPC style, make sure the operation style includes a 'namespace' attribute (WS-I Basic Profile 1.1 R2717)
$operationBodyStyle = $this->operationBodyStyle;
if ($this->bindingStyle['style'] == 'rpc' && !isset($operationBodyStyle['namespace'])) {
$operationBodyStyle['namespace'] = ''.$uri;
$operationBodyStyle['namespace'] = '' . $uri;
}

// Add the binding operation
Expand All @@ -507,7 +510,8 @@ protected function _addFunctionToWsdl($function, $wsdl, $port, $binding)
/**
* Generate the WSDL file from the configured input.
*
* @return Zend_Wsdl
* @throws Exception\RuntimeException
* @return Wsdl
*/
public function generate()
{
Expand Down
7 changes: 4 additions & 3 deletions src/Client.php
Expand Up @@ -349,7 +349,7 @@ public function getSoapVersion()
*/
public function setClassmap(array $classmap)
{
foreach ($classmap as $type => $class) {
foreach ($classmap as $class) {
if (!class_exists($class)) {
throw new Exception\InvalidArgumentException('Invalid class in class map');
}
Expand Down Expand Up @@ -666,7 +666,7 @@ public function getProxyLogin()
/**
* Set proxy password
*
* @param string $proxyLogin
* @param string $proxyPassword
* @return \Zend\Soap\Client
*/
public function setProxyPassword($proxyPassword)
Expand Down Expand Up @@ -774,6 +774,7 @@ public function getProxyPassword()
/**
* Set Stream Context
*
* @param resource $context
* @return \Zend\Soap\Client
*/
public function setStreamContext($context)
Expand Down Expand Up @@ -1140,7 +1141,7 @@ public function getTypes()
}

/**
* @param SoapClient $soapClient
* @param \SoapClient $soapClient
* @return \Zend\Soap\Client
*/
public function setSoapClient(\SoapClient $soapClient)
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Common.php
Expand Up @@ -29,7 +29,7 @@ class Common extends \SoapClient
/**
* Common Soap Client constructor
*
* @param callable $doRequestMethod
* @param callable $doRequestCallback
* @param string $wsdl
* @param array $options
*/
Expand Down
15 changes: 9 additions & 6 deletions src/Server.php
Expand Up @@ -385,7 +385,7 @@ public function setClassmap($classmap)
if (!is_array($classmap)) {
throw new Exception\InvalidArgumentException('Classmap must be an array');
}
foreach ($classmap as $type => $class) {
foreach ($classmap as $class) {
if (!class_exists($class)) {
throw new Exception\InvalidArgumentException('Invalid class in class map');
}
Expand Down Expand Up @@ -557,6 +557,7 @@ public function setClass($class, $namespace = '', $argv = null)
* Accepts an instanciated object to use when handling requests.
*
* @param object $object
* @throws Exception\InvalidArgumentException
* @return Server
*/
public function setObject($object)
Expand Down Expand Up @@ -599,7 +600,7 @@ public function getFunctions()
/**
* Unimplemented: Load server definition
*
* @param array $array
* @param array $definition
* @return void
* @throws Exception\RuntimeException Unimplemented
*/
Expand All @@ -612,6 +613,7 @@ public function loadFunctions($definition)
* Set server persistence
*
* @param int $mode
* @throws Exception\InvalidArgumentException
* @return Server
*/
public function setPersistence($mode)
Expand Down Expand Up @@ -645,6 +647,7 @@ public function getPersistence()
* - string; if so, verifies XML
*
* @param DOMDocument|DOMNode|SimpleXMLElement|stdClass|string $request
* @throws Exception\InvalidArgumentException
* @return Server
*/
protected function _setRequest($request)
Expand Down Expand Up @@ -733,7 +736,7 @@ public function getResponse()
* SoapServer object, and then registers any functions or class with it, as
* well as persistence.
*
* @return SoapServer
* @return \SoapServer
*/
protected function _getSoap()
{
Expand Down Expand Up @@ -891,9 +894,9 @@ public function getFaultExceptions()
* {@Link registerFaultException()}.
*
* @link http://www.w3.org/TR/soap12-part1/#faultcodes
* @param string|Exception $fault
* @param string|\Exception $fault
* @param string $code SOAP Fault Codes
* @return SoapFault
* @return \SoapFault
*/
public function fault($fault = null, $code = "Receiver")
{
Expand Down Expand Up @@ -932,7 +935,7 @@ public function fault($fault = null, $code = "Receiver")
* @param int $errline
* @param array $errcontext
* @return void
* @throws SoapFault
* @throws \SoapFault
*/
public function handlePhpErrors($errno, $errstr, $errfile = null, $errline = null, array $errcontext = null)
{
Expand Down
3 changes: 2 additions & 1 deletion src/Server/DocumentLiteralWrapper.php
Expand Up @@ -118,6 +118,7 @@ public function __call($method, $args)
*
* @param string $method
* @param object $document
* @throws UnexpectedValueException
* @return array
*/
protected function _parseArguments($method, $document)
Expand All @@ -143,7 +144,7 @@ protected function _parseArguments($method, $document)

protected function _getResultMessage($method, $ret)
{
return array($method.'Result' => $ret);
return array($method . 'Result' => $ret);
}

protected function _assertServiceDelegateHasMethod($method)
Expand Down
10 changes: 6 additions & 4 deletions src/Wsdl.php
Expand Up @@ -67,7 +67,9 @@ class Wsdl
*
* @param string $name Name of the Web Service being Described
* @param string|Uri $uri URI where the WSDL will be available
* @param ComplexTypeStrategy $strategy
* @param null|ComplexTypeStrategy $strategy Strategy for detection of complex types
* @param null|array $classMap Map of PHP Class names to WSDL QNames
* @throws Exception\RuntimeException
*/
public function __construct($name, $uri, ComplexTypeStrategy $strategy = null, array $classMap = array())
{
Expand Down Expand Up @@ -265,7 +267,7 @@ public function addPortOperation($portType, $name, $input = false, $output = fal
* Add a {@link http://www.w3.org/TR/wsdl#_bindings binding} element to WSDL
*
* @param string $name Name of the Binding
* @param string $type name of the portType to bind
* @param string $portType name of the portType to bind
* @return object The new binding's XML_Tree_Node for use with {@link function addBindingOperation} and {@link function addDocumentation}
*/
public function addBinding($name, $portType)
Expand Down Expand Up @@ -519,9 +521,8 @@ public function dump($filename = false)
if (!$filename) {
echo $this->toXML();
return true;
} else {
return file_put_contents($filename, $this->toXML());
}
return file_put_contents($filename, $this->toXML());
}

/**
Expand Down Expand Up @@ -626,6 +627,7 @@ public function addComplexType($type)
* Parse an xsd:element represented as an array into a DOMElement.
*
* @param array $element an xsd:element represented as an array
* @throws Exception\RuntimeException if $element is not an array
* @return DOMElement parsed element
*/
private function _parseElement($element)
Expand Down
1 change: 1 addition & 0 deletions src/Wsdl/ComplexTypeStrategy/ArrayOfTypeComplex.php
Expand Up @@ -25,6 +25,7 @@ class ArrayOfTypeComplex extends DefaultComplexType
* Add an ArrayOfType based on the xsd:complexType syntax if type[] is detected in return value doc comment.
*
* @param string $type
* @throws Exception\InvalidArgumentException
* @return string tns:xsd-type
*/
public function addComplexType($type)
Expand Down
6 changes: 4 additions & 2 deletions src/Wsdl/ComplexTypeStrategy/ComplexTypeStrategyInterface.php
Expand Up @@ -10,6 +10,8 @@

namespace Zend\Soap\Wsdl\ComplexTypeStrategy;

use Zend\Soap\Wsdl;

/**
* Interface strategies that generate an XSD-Schema for complex data types in WSDL files.
*
Expand All @@ -22,9 +24,9 @@ interface ComplexTypeStrategyInterface
/**
* Method accepts the current WSDL context file.
*
* @param <type> $context
* @param Wsdl $context
*/
public function setContext(\Zend\Soap\Wsdl $context);
public function setContext(Wsdl $context);

/**
* Create a complex type based on a strategy
Expand Down
1 change: 0 additions & 1 deletion src/Wsdl/ComplexTypeStrategy/Composite.php
Expand Up @@ -79,7 +79,6 @@ public function connectTypeToStrategy($type, $strategy)
* Return default strategy of this composite
*
* @throws Exception\InvalidArgumentException
* @param string $type
* @return ComplexTypeStrategy
*/
public function getDefaultStrategy()
Expand Down
3 changes: 1 addition & 2 deletions src/Wsdl/ComplexTypeStrategy/DefaultComplexType.php
Expand Up @@ -25,6 +25,7 @@ class DefaultComplexType extends AbstractComplexTypeStrategy
* Add a complex type by recursivly using all the class properties fetched via Reflection.
*
* @param string $type Name of the class to be specified
* @throws Exception\InvalidArgumentException if class does not exist
* @return string XSD Type for the given PHP type
*/
public function addComplexType($type)
Expand All @@ -50,8 +51,6 @@ public function addComplexType($type)
$this->getContext()->addType($type, $soapType);


$defaultProperties = $class->getDefaultProperties();

$defaultProperties = $class->getDefaultProperties();

$complexType = $dom->createElement('xsd:complexType');
Expand Down

0 comments on commit 64f42ce

Please sign in to comment.