Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Commit 8d7016d

Browse files
committed
Merge branch 'hotfix/dependencies'
Close #17
2 parents 2993f22 + 3ee5397 commit 8d7016d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+791
-671
lines changed

.coveralls.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
coverage_clover: clover.xml
22
json_path: coveralls-upload.json
3-
src_dir: src

.php_cs

-45
This file was deleted.

.travis.yml

+9-10
Original file line numberDiff line numberDiff line change
@@ -26,38 +26,37 @@ matrix:
2626
include:
2727
- php: 5.5
2828
env:
29-
- EXECUTE_CS_CHECK=true
29+
- CS_CHECK=true
3030
- php: 5.6
3131
env:
32-
- EXECUTE_TEST_COVERALLS=true
32+
- TEST_COVERAGE=true
3333
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
3434
- PATH="$HOME/.local/bin:$PATH"
3535
- php: 7
3636
- php: hhvm
3737
allow_failures:
38-
- php: 7
3938
- php: hhvm
4039

4140
notifications:
4241
irc: "irc.freenode.org#zftalk.dev"
4342
email: false
4443

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

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

5352
script:
54-
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/phpunit --coverage-clover clover.xml ; fi
55-
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then ./vendor/bin/phpunit ; fi
56-
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then ./vendor/bin/php-cs-fixer fix -v --diff --dry-run ; fi
53+
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; fi
54+
- if [[ $TEST_COVERAGE != 'true' ]]; then composer test ; fi
55+
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
5756
- 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
5857

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

6261
after_script:
63-
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then ./vendor/bin/coveralls ; fi
62+
- if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ All notable changes to this project will be documented in this file, in reverse
2525

2626
### Fixed
2727

28-
- Nothing.
28+
- [#17](https://github.com/zendframework/zend-xmlrpc/pull/17) updates
29+
dependencies to allow zend-stdlib v3 releases.

composer.json

+28-15
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,25 @@
1212
"Zend\\XmlRpc\\": "src/"
1313
}
1414
},
15+
"autoload-dev": {
16+
"psr-4": {
17+
"ZendTest\\XmlRpc\\": "test/"
18+
},
19+
"files": [
20+
"test/TestAsset/functions.php"
21+
]
22+
},
1523
"require": {
16-
"php": ">=5.5",
17-
"zendframework/zend-http": "~2.5",
18-
"zendframework/zend-math": "~2.5",
19-
"zendframework/zend-server": "~2.5",
20-
"zendframework/zend-stdlib": "~2.5",
21-
"zendframework/zendxml": "1.*"
24+
"php": "^5.5 || ^7.0",
25+
"zendframework/zend-http": "^2.5.4",
26+
"zendframework/zend-math": "^2.7",
27+
"zendframework/zend-server": "^2.6.1",
28+
"zendframework/zend-stdlib": "^2.7 || ^3.0",
29+
"zendframework/zendxml": "^1.0.2"
30+
},
31+
"require-dev": {
32+
"phpunit/PHPUnit": "^4.8",
33+
"squizlabs/php_codesniffer": "^2.3.1"
2234
},
2335
"suggest": {
2436
"zendframework/zend-cache": "To support Zend\\XmlRpc\\Server\\Cache usage"
@@ -31,14 +43,15 @@
3143
"dev-develop": "2.6-dev"
3244
}
3345
},
34-
"autoload-dev": {
35-
"psr-4": {
36-
"ZendTest\\XmlRpc\\": "test/"
37-
}
38-
},
39-
"require-dev": {
40-
"fabpot/php-cs-fixer": "1.7.*",
41-
"phpunit/PHPUnit": "~4.0",
42-
"zendframework/zend-servicemanager": "~2.5"
46+
"scripts": {
47+
"check": [
48+
"@cs-check",
49+
"@test"
50+
],
51+
"upload-coverage": "coveralls -v",
52+
"cs-check": "phpcs",
53+
"cs-fix": "phpcbf",
54+
"test": "phpunit",
55+
"test-coverage": "phpunit --coverage-clover clover.xml"
4356
}
4457
}

phpcs.xml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Zend Framework coding standard">
3+
<description>Zend Framework coding standard</description>
4+
5+
<!-- display progress -->
6+
<arg value="p"/>
7+
<arg name="colors"/>
8+
9+
<!-- inherit rules from: -->
10+
<rule ref="PSR2"/>
11+
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
12+
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
13+
<properties>
14+
<property name="ignoreBlankLines" value="false"/>
15+
</properties>
16+
</rule>
17+
18+
<!-- Paths to check -->
19+
<file>src</file>
20+
<file>test</file>
21+
<exclude-pattern>test/_files/*</exclude-pattern>
22+
<exclude-pattern>test/TestAsset/*</exclude-pattern>
23+
</ruleset>

phpunit.xml.dist

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4-
bootstrap="./test/bootstrap.php"
4+
bootstrap="./vendor/autoload.php"
55
colors="true">
66
<testsuites>
77
<testsuite name="zend-xmlrpc Test Suite">

src/AbstractValue.php

+16-15
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace Zend\XmlRpc;
1111

1212
use DateTime;
13+
use SimpleXMLElement;
1314

1415
/**
1516
* Represent a native XML-RPC value entity, used as parameters for the methods
@@ -155,7 +156,7 @@ public function saveXml()
155156
*/
156157
public function generateXml()
157158
{
158-
$this->_generateXml();
159+
$this->generate();
159160
}
160161

161162
/**
@@ -178,11 +179,11 @@ public static function getXmlRpcValue($value, $type = self::AUTO_DETECT_TYPE)
178179
switch ($type) {
179180
case self::AUTO_DETECT_TYPE:
180181
// Auto detect the XML-RPC native type from the PHP type of $value
181-
return static::_phpVarToNativeXmlRpc($value);
182+
return static::phpVarToNativeXmlRpc($value);
182183

183184
case self::XML_STRING:
184185
// Parse the XML string given in $value and get the XML-RPC value in it
185-
return static::_xmlStringToNativeXmlRpc($value);
186+
return static::xmlStringToNativeXmlRpc($value);
186187

187188
case self::XMLRPC_TYPE_I4:
188189
// fall through to the next case
@@ -273,7 +274,7 @@ public static function getXmlRpcTypeByValue($value)
273274
* @return AbstractValue
274275
* @static
275276
*/
276-
protected static function _phpVarToNativeXmlRpc($value)
277+
protected static function phpVarToNativeXmlRpc($value)
277278
{
278279
// @see http://framework.zend.com/issues/browse/ZF-8623
279280
if ($value instanceof AbstractValue) {
@@ -320,11 +321,11 @@ protected static function _phpVarToNativeXmlRpc($value)
320321
* @return \Zend\XmlRpc\AbstractValue
321322
* @static
322323
*/
323-
protected static function _xmlStringToNativeXmlRpc($xml)
324+
protected static function xmlStringToNativeXmlRpc($xml)
324325
{
325-
static::_createSimpleXMLElement($xml);
326+
static::createSimpleXMLElement($xml);
326327

327-
static::_extractTypeAndValue($xml, $type, $value);
328+
static::extractTypeAndValue($xml, $type, $value);
328329

329330
switch ($type) {
330331
// All valid and known XML-RPC native values
@@ -381,7 +382,7 @@ protected static function _xmlStringToNativeXmlRpc($xml)
381382
// Parse all the elements of the array from the XML string
382383
// (simple xml element) to Value objects
383384
foreach ($data->value as $element) {
384-
$values[] = static::_xmlStringToNativeXmlRpc($element);
385+
$values[] = static::xmlStringToNativeXmlRpc($element);
385386
}
386387
$xmlrpcValue = new Value\ArrayValue($values);
387388
break;
@@ -395,7 +396,7 @@ protected static function _xmlStringToNativeXmlRpc($xml)
395396
if (!isset($member->value) or !isset($member->name)) {
396397
continue;
397398
}
398-
$values[(string) $member->name] = static::_xmlStringToNativeXmlRpc($member->value);
399+
$values[(string) $member->name] = static::xmlStringToNativeXmlRpc($member->value);
399400
}
400401
$xmlrpcValue = new Value\Struct($values);
401402
break;
@@ -405,19 +406,19 @@ protected static function _xmlStringToNativeXmlRpc($xml)
405406
);
406407
break;
407408
}
408-
$xmlrpcValue->_setXML($xml->asXML());
409+
$xmlrpcValue->setXML($xml->asXML());
409410

410411
return $xmlrpcValue;
411412
}
412413

413-
protected static function _createSimpleXMLElement(&$xml)
414+
protected static function createSimpleXMLElement(&$xml)
414415
{
415-
if ($xml instanceof \SimpleXMLElement) {
416+
if ($xml instanceof SimpleXMLElement) {
416417
return;
417418
}
418419

419420
try {
420-
$xml = new \SimpleXMLElement($xml);
421+
$xml = new SimpleXMLElement($xml);
421422
} catch (\Exception $e) {
422423
// The given string is not a valid XML
423424
throw new Exception\ValueException(
@@ -436,7 +437,7 @@ protected static function _createSimpleXMLElement(&$xml)
436437
* @param string &$value Value bind variable
437438
* @return void
438439
*/
439-
protected static function _extractTypeAndValue(\SimpleXMLElement $xml, &$type, &$value)
440+
protected static function extractTypeAndValue(\SimpleXMLElement $xml, &$type, &$value)
440441
{
441442
// Casting is necessary to work with strict-typed systems
442443
$xmlAsArray = (array) $xml;
@@ -467,7 +468,7 @@ protected static function _extractTypeAndValue(\SimpleXMLElement $xml, &$type, &
467468
* @param $xml
468469
* @return void
469470
*/
470-
protected function _setXML($xml)
471+
protected function setXML($xml)
471472
{
472473
$this->xml = $this->getGenerator()->stripDeclaration($xml);
473474
}

src/Client.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ public function call($method, $params = [])
304304
}
305305
}
306306

307-
$request = $this->_createRequest($method, $params);
307+
$request = $this->createRequest($method, $params);
308308

309309
$this->doRequest($request);
310310

@@ -329,7 +329,7 @@ public function call($method, $params = [])
329329
* @param array $params
330330
* @return \Zend\XmlRpc\Request
331331
*/
332-
protected function _createRequest($method, $params)
332+
protected function createRequest($method, $params)
333333
{
334334
return new Request($method, $params);
335335
}

src/Generator/AbstractGenerator.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ abstract class AbstractGenerator implements GeneratorInterface
2929
public function __construct($encoding = 'UTF-8')
3030
{
3131
$this->setEncoding($encoding);
32-
$this->_init();
32+
$this->init();
3333
}
3434

3535
/**
3636
* Initialize internal objects
3737
*
3838
* @return void
3939
*/
40-
abstract protected function _init();
40+
abstract protected function init();
4141

4242
/**
4343
* Start XML element
@@ -50,9 +50,9 @@ abstract protected function _init();
5050
*/
5151
public function openElement($name, $value = null)
5252
{
53-
$this->_openElement($name);
53+
$this->openXmlElement($name);
5454
if ($value !== null) {
55-
$this->_writeTextData($value);
55+
$this->writeTextData($value);
5656
}
5757

5858
return $this;
@@ -68,7 +68,7 @@ public function openElement($name, $value = null)
6868
*/
6969
public function closeElement($name)
7070
{
71-
$this->_closeElement($name);
71+
$this->closeXmlElement($name);
7272

7373
return $this;
7474
}
@@ -103,7 +103,7 @@ public function setEncoding($encoding)
103103
public function flush()
104104
{
105105
$xml = $this->saveXml();
106-
$this->_init();
106+
$this->init();
107107
return $xml;
108108
}
109109

@@ -133,19 +133,19 @@ public function stripDeclaration($xml)
133133
*
134134
* @param string $name XML element name
135135
*/
136-
abstract protected function _openElement($name);
136+
abstract protected function openXmlElement($name);
137137

138138
/**
139139
* Write XML text data into the currently opened XML element
140140
*
141141
* @param string $text
142142
*/
143-
abstract protected function _writeTextData($text);
143+
abstract protected function writeTextData($text);
144144

145145
/**
146146
* End XML element
147147
*
148148
* @param string $name
149149
*/
150-
abstract protected function _closeElement($name);
150+
abstract protected function closeXmlElement($name);
151151
}

0 commit comments

Comments
 (0)