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

Commit

Permalink
Merge branch 'hotfix/dependencies'
Browse files Browse the repository at this point in the history
Close #21
  • Loading branch information
weierophinney committed Apr 21, 2016
2 parents c2a87cb + f91ab53 commit da96542
Show file tree
Hide file tree
Showing 33 changed files with 888 additions and 568 deletions.
1 change: 0 additions & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
coverage_clover: clover.xml
json_path: coveralls-upload.json
src_dir: src
45 changes: 0 additions & 45 deletions .php_cs

This file was deleted.

19 changes: 9 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,37 @@ matrix:
include:
- php: 5.5
env:
- EXECUTE_CS_CHECK=true
- CS_CHECK=true
- php: 5.6
env:
- EXECUTE_TEST_COVERALLS=true
- TEST_COVERAGE=true
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
- PATH="$HOME/.local/bin:$PATH"
- php: 7
- php: hhvm
allow_failures:
- php: 7
- php: hhvm

notifications:
irc: "irc.freenode.org#zftalk.dev"
email: false

before_install:
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- composer self-update
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
- travis_retry composer self-update

install:
- if [[ $TEST_COVERAGE == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi
- travis_retry composer install --no-interaction --ignore-platform-reqs

script:
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; fi
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then ./vendor/bin/phpunit ; fi
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/php-cs-fixer fix -v --diff --dry-run ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; fi
- if [[ $TEST_COVERAGE != 'true' ]]; then composer test; fi
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
- if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi

after_success:
- if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi

after_script:
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/coveralls ; fi
- if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer upload-coverage ; fi
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 2.5.2 - 2016-04-20
## 2.5.2 - 2016-04-21

### Added

Expand All @@ -20,3 +20,5 @@ All notable changes to this project will be documented in this file, in reverse

- [#7](https://github.com/zendframework/zend-soap/pull/7) fixes
behavior when the request contains empty content.
- [#21](https://github.com/zendframework/zend-soap/pull/21) updates the
dependencies to allow usage with zend-stdlib v3 releases.
33 changes: 24 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
}
},
"require": {
"php": ">=5.5",
"zendframework/zend-server": "~2.5",
"zendframework/zend-stdlib": "~2.5",
"zendframework/zend-uri": "~2.5"
"php": "^5.5 || ^7.0",
"zendframework/zend-server": "^2.6.1",
"zendframework/zend-stdlib": "^2.7 || ^3.0",
"zendframework/zend-uri": "^2.5.2"
},
"require-dev": {
"zendframework/zend-config": "~2.5",
"zendframework/zend-http": "~2.5",
"fabpot/php-cs-fixer": "1.7.*",
"phpunit/PHPUnit": "~4.0"
"zendframework/zend-config": "^2.6",
"zendframework/zend-http": "^2.5.4",
"phpunit/PHPUnit": "^4.8",
"squizlabs/php_codesniffer": "^2.3.1"
},
"suggest": {
"zendframework/zend-http": "Zend\\Http component"
Expand All @@ -38,6 +38,21 @@
"autoload-dev": {
"psr-4": {
"ZendTest\\Soap\\": "test/"
}
},
"files": [
"test/TestAsset/commontypes.php",
"test/TestAsset/call_user_func.php"
]
},
"scripts": {
"check": [
"@cs-check",
"@test"
],
"upload-coverage": "coveralls -v",
"cs-check": "phpcs",
"cs-fix": "phpcbf",
"test": "phpunit",
"test-coverage": "phpunit --coverage-clover clover.xml"
}
}
23 changes: 23 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<ruleset name="Zend Framework coding standard">
<description>Zend Framework coding standard</description>

<!-- display progress -->
<arg value="p"/>
<arg name="colors"/>

<!-- inherit rules from: -->
<rule ref="PSR2"/>
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>

<!-- Paths to check -->
<file>src</file>
<file>test</file>
<exclude-pattern>test/_files/*</exclude-pattern>
<exclude-pattern>test/TestAsset/*</exclude-pattern>
</ruleset>
31 changes: 19 additions & 12 deletions src/AutoDiscover.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,23 +377,23 @@ public function addFunction($function)
*
* @return Wsdl
*/
protected function _generateClass()
protected function generateClass()
{
return $this->_generateWsdl($this->reflection->reflectClass($this->class)->getMethods());
return $this->generateWsdl($this->reflection->reflectClass($this->class)->getMethods());
}

/**
* Generate the WSDL for a set of functions.
*
* @return Wsdl
*/
protected function _generateFunctions()
protected function generateFunctions()
{
$methods = [];
foreach (array_unique($this->functions) as $func) {
$methods[] = $this->reflection->reflectFunction($func);
}
return $this->_generateWsdl($methods);
return $this->generateWsdl($methods);
}

/**
Expand All @@ -402,7 +402,7 @@ protected function _generateFunctions()
* @param array $reflectionMethods
* @return Wsdl
*/
protected function _generateWsdl(array $reflectionMethods)
protected function generateWsdl(array $reflectionMethods)
{
$uri = $this->getUri();

Expand All @@ -417,10 +417,15 @@ protected function _generateWsdl(array $reflectionMethods)
$binding = $wsdl->addBinding($serviceName . 'Binding', Wsdl::TYPES_NS . ':' . $serviceName . 'Port');

$wsdl->addSoapBinding($binding, $this->bindingStyle['style'], $this->bindingStyle['transport']);
$wsdl->addService($serviceName . 'Service', $serviceName . 'Port', Wsdl::TYPES_NS . ':' . $serviceName . 'Binding', $uri);
$wsdl->addService(
$serviceName . 'Service',
$serviceName . 'Port',
Wsdl::TYPES_NS . ':' . $serviceName . 'Binding',
$uri
);

foreach ($reflectionMethods as $method) {
$this->_addFunctionToWsdl($method, $wsdl, $port, $binding);
$this->addFunctionToWsdl($method, $wsdl, $port, $binding);
}

return $wsdl;
Expand All @@ -435,7 +440,7 @@ protected function _generateWsdl(array $reflectionMethods)
* @param $binding \DOMElement wsdl:binding
* @throws Exception\InvalidArgumentException
*/
protected function _addFunctionToWsdl($function, $wsdl, $port, $binding)
protected function addFunctionToWsdl($function, $wsdl, $port, $binding)
{
$uri = $this->getUri();

Expand Down Expand Up @@ -528,13 +533,15 @@ protected function _addFunctionToWsdl($function, $wsdl, $port, $binding)
$portOperation = $wsdl->addPortOperation(
$port,
$functionName,
Wsdl::TYPES_NS . ':' . $functionName . 'In', Wsdl::TYPES_NS . ':' . $functionName . 'Out'
Wsdl::TYPES_NS . ':' . $functionName . 'In',
Wsdl::TYPES_NS . ':' . $functionName . 'Out'
);
} else {
$portOperation = $wsdl->addPortOperation(
$port,
$functionName,
Wsdl::TYPES_NS . ':' . $functionName . 'In', false
Wsdl::TYPES_NS . ':' . $functionName . 'In',
false
);
}
$desc = $this->discoveryStrategy->getFunctionDocumentation($function);
Expand Down Expand Up @@ -572,9 +579,9 @@ public function generate()
}

if ($this->class) {
$wsdl = $this->_generateClass();
$wsdl = $this->generateClass();
} else {
$wsdl = $this->_generateFunctions();
$wsdl = $this->generateFunctions();
}

return $wsdl;
Expand Down
46 changes: 35 additions & 11 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,15 +405,21 @@ public function getClassmap()
public function setTypemap(array $typeMap)
{
foreach ($typeMap as $type) {
if (!is_callable($type['from_xml'])) {
throw new Exception\InvalidArgumentException('Invalid from_xml callback for type: ' . $type['type_name']);
if (! is_callable($type['from_xml'])) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid from_xml callback for type: %s',
$type['type_name']
));
}
if (!is_callable($type['to_xml'])) {
throw new Exception\InvalidArgumentException('Invalid to_xml callback for type: ' . $type['type_name']);
if (! is_callable($type['to_xml'])) {
throw new Exception\InvalidArgumentException(sprintf(
'Invalid to_xml callback for type: %s',
$type['type_name']
));
}
}

$this->typemap = $typeMap;
$this->typemap = $typeMap;
$this->soapClient = null;
return $this;
}
Expand Down Expand Up @@ -971,6 +977,7 @@ public function getLastMethod()
return $this->lastMethod;
}

// @codingStandardsIgnoreStart
/**
* Do request proxy method.
*
Expand All @@ -988,17 +995,31 @@ public function _doRequest(Client\Common $client, $request, $location, $action,
{
// Perform request as is
if ($oneWay === null) {
return call_user_func([$client, 'SoapClient::__doRequest'], $request, $location, $action, $version);
return call_user_func(
[$client, 'SoapClient::__doRequest'],
$request,
$location,
$action,
$version
);
}
return call_user_func([$client, 'SoapClient::__doRequest'], $request, $location, $action, $version, $oneWay);
return call_user_func(
[$client, 'SoapClient::__doRequest'],
$request,
$location,
$action,
$version,
$oneWay
);
}
// @codingStandardsIgnoreEnd

/**
* Initialize SOAP Client object
*
* @throws Exception\ExceptionInterface
*/
protected function _initSoapClientObject()
protected function initSoapClientObject()
{
$wsdl = $this->getWSDL();
$options = array_merge($this->getOptions(), ['trace' => true]);
Expand All @@ -1023,7 +1044,7 @@ protected function _initSoapClientObject()
$this->soapClient = new Client\Common([$this, '_doRequest'], $wsdl, $options);
}


// @codingStandardsIgnoreStart
/**
* Perform arguments pre-processing
*
Expand All @@ -1037,7 +1058,9 @@ protected function _preProcessArguments($arguments)
// Do nothing
return $arguments;
}
// @codingStandardsIgnoreEnd

// @codingStandardsIgnoreStart
/**
* Perform result pre-processing
*
Expand All @@ -1051,6 +1074,7 @@ protected function _preProcessResult($result)
// Do nothing
return $result;
}
// @codingStandardsIgnoreEnd

/**
* Add SOAP input header
Expand Down Expand Up @@ -1192,7 +1216,7 @@ public function setSoapClient(SoapClient $soapClient)
public function getSoapClient()
{
if ($this->soapClient === null) {
$this->_initSoapClientObject();
$this->initSoapClientObject();
}
return $this->soapClient;
}
Expand All @@ -1204,7 +1228,7 @@ public function getSoapClient()
* @param string $cookieValue
* @return self
*/
public function setCookie($cookieName, $cookieValue=null)
public function setCookie($cookieName, $cookieValue = null)
{
$soapClient = $this->getSoapClient();
$soapClient->__setCookie($cookieName, $cookieValue);
Expand Down
Loading

0 comments on commit da96542

Please sign in to comment.