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

Commit

Permalink
Merge branch 'develop' of git://github.com/zendframework/zf2 into fea…
Browse files Browse the repository at this point in the history
…ture/cache-session-storage

Conflicts:
	CHANGELOG.md
  • Loading branch information
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
30 changes: 15 additions & 15 deletions src/AbstractValue.php
Expand Up @@ -95,15 +95,15 @@ public function getType()
*/
public static function getGenerator()
{
if (!self::$generator) {
if (!static::$generator) {
if (extension_loaded('xmlwriter')) {
self::$generator = new Generator\XmlWriter();
static::$generator = new Generator\XmlWriter();
} else {
self::$generator = new Generator\DomDocument();
static::$generator = new Generator\DomDocument();
}
}

return self::$generator;
return static::$generator;
}

/**
Expand All @@ -114,7 +114,7 @@ public static function getGenerator()
*/
public static function setGenerator(Generator\GeneratorInterface $generator = null)
{
self::$generator = $generator;
static::$generator = $generator;
}

/**
Expand All @@ -125,9 +125,9 @@ public static function setGenerator(Generator\GeneratorInterface $generator = nu
*/
public static function setEncoding($encoding)
{
$generator = self::getGenerator();
$generator = static::getGenerator();
$newGenerator = new $generator($encoding);
self::setGenerator($newGenerator);
static::setGenerator($newGenerator);
}

/**
Expand Down Expand Up @@ -182,11 +182,11 @@ public static function getXmlRpcValue($value, $type = self::AUTO_DETECT_TYPE)
switch ($type) {
case self::AUTO_DETECT_TYPE:
// Auto detect the XML-RPC native type from the PHP type of $value
return self::_phpVarToNativeXmlRpc($value);
return static::_phpVarToNativeXmlRpc($value);

case self::XML_STRING:
// Parse the XML string given in $value and get the XML-RPC value in it
return self::_xmlStringToNativeXmlRpc($value);
return static::_xmlStringToNativeXmlRpc($value);

case self::XMLRPC_TYPE_I4:
// fall through to the next case
Expand Down Expand Up @@ -245,7 +245,7 @@ public static function getXmlRpcTypeByValue($value)
} elseif ($value instanceof DateTime) {
return self::XMLRPC_TYPE_DATETIME;
}
return self::getXmlRpcTypeByValue(get_object_vars($value));
return static::getXmlRpcTypeByValue(get_object_vars($value));
} elseif (is_array($value)) {
if (!empty($value) && is_array($value) && (array_keys($value) !== range(0, count($value) - 1))) {
return self::XMLRPC_TYPE_STRUCT;
Expand Down Expand Up @@ -293,7 +293,7 @@ protected static function _phpVarToNativeXmlRpc($value)
}
}

switch (self::getXmlRpcTypeByValue($value)) {
switch (static::getXmlRpcTypeByValue($value)) {
case self::XMLRPC_TYPE_DATETIME:
return new Value\DateTime($value);

Expand Down Expand Up @@ -335,9 +335,9 @@ protected static function _phpVarToNativeXmlRpc($value)
*/
protected static function _xmlStringToNativeXmlRpc($xml)
{
self::_createSimpleXMLElement($xml);
static::_createSimpleXMLElement($xml);

self::_extractTypeAndValue($xml, $type, $value);
static::_extractTypeAndValue($xml, $type, $value);

switch ($type) {
// All valid and known XML-RPC native values
Expand Down Expand Up @@ -390,7 +390,7 @@ protected static function _xmlStringToNativeXmlRpc($xml)
// Parse all the elements of the array from the XML string
// (simple xml element) to Value objects
foreach ($data->value as $element) {
$values[] = self::_xmlStringToNativeXmlRpc($element);
$values[] = static::_xmlStringToNativeXmlRpc($element);
}
$xmlrpcValue = new Value\ArrayValue($values);
break;
Expand All @@ -405,7 +405,7 @@ protected static function _xmlStringToNativeXmlRpc($xml)
continue;
//throw new Value_Exception('Member of the '. self::XMLRPC_TYPE_STRUCT .' XML-RPC native type must contain a VALUE tag');
}
$values[(string)$member->name] = self::_xmlStringToNativeXmlRpc($member->value);
$values[(string)$member->name] = static::_xmlStringToNativeXmlRpc($member->value);
}
$xmlrpcValue = new Value\Struct($values);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/Server.php
Expand Up @@ -439,7 +439,7 @@ public function getResponse()
*/
public function setResponseClass($class)
{
if (!class_exists($class) || !self::isSubclassOf($class, 'Zend\XmlRpc\Response')) {
if (!class_exists($class) || !static::isSubclassOf($class, 'Zend\XmlRpc\Response')) {
throw new Server\Exception\InvalidArgumentException('Invalid response class');

}
Expand Down
20 changes: 10 additions & 10 deletions src/Server/Fault.php
Expand Up @@ -58,7 +58,7 @@ public function __construct(\Exception $e)
$code = 404;
$message = 'Unknown error';

foreach (array_keys(self::$faultExceptionClasses) as $class) {
foreach (array_keys(static::$faultExceptionClasses) as $class) {
if ($e instanceof $class) {
$code = $e->getCode();
$message = $e->getMessage();
Expand All @@ -69,8 +69,8 @@ public function __construct(\Exception $e)
parent::__construct($code, $message);

// Notify exception observers, if present
if (!empty(self::$observers)) {
foreach (array_keys(self::$observers) as $observer) {
if (!empty(static::$observers)) {
foreach (array_keys(static::$observers) as $observer) {
$observer::observe($this);
}
}
Expand Down Expand Up @@ -101,7 +101,7 @@ public static function attachFaultException($classes)

foreach ($classes as $class) {
if (is_string($class) && class_exists($class)) {
self::$faultExceptionClasses[$class] = true;
static::$faultExceptionClasses[$class] = true;
}
}
}
Expand All @@ -119,8 +119,8 @@ public static function detachFaultException($classes)
}

foreach ($classes as $class) {
if (is_string($class) && isset(self::$faultExceptionClasses[$class])) {
unset(self::$faultExceptionClasses[$class]);
if (is_string($class) && isset(static::$faultExceptionClasses[$class])) {
unset(static::$faultExceptionClasses[$class]);
}
}
}
Expand All @@ -146,8 +146,8 @@ public static function attachObserver($class)
return false;
}

if (!isset(self::$observers[$class])) {
self::$observers[$class] = true;
if (!isset(static::$observers[$class])) {
static::$observers[$class] = true;
}

return true;
Expand All @@ -161,11 +161,11 @@ public static function attachObserver($class)
*/
public static function detachObserver($class)
{
if (!isset(self::$observers[$class])) {
if (!isset(static::$observers[$class])) {
return false;
}

unset(self::$observers[$class]);
unset(static::$observers[$class]);
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Value/AbstractCollection.php
Expand Up @@ -32,7 +32,7 @@ public function __construct($value)
// If the elements of the given array are not Zend_XmlRpc_Value objects,
// we need to convert them as such (using auto-detection from PHP value)
if (!$value instanceof parent) {
$value = self::getXmlRpcValue($value, self::AUTO_DETECT_TYPE);
$value = static::getXmlRpcValue($value, self::AUTO_DETECT_TYPE);
}
$this->value[$key] = $value;
}
Expand Down

0 comments on commit 0351056

Please sign in to comment.