X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2FValue.php;h=2627e58cb44e025ff9be24c0e37fcb62f1babe02;hb=b08a42e525d486f753ae8c1b2e79041c99d05601;hp=fa402a5eae498786b00b2c2dc59809946ecfb00f;hpb=3fbb2c97e3c462f1e3668c30a77980d08c845243;p=plcapi.git diff --git a/src/Value.php b/src/Value.php index fa402a5..2627e58 100644 --- a/src/Value.php +++ b/src/Value.php @@ -261,7 +261,7 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess // sprintf('%F') could be most likely ok but it fails eg. on 2e-14. // The code below tries its best at keeping max precision while avoiding exp notation, // but there is of course no limit in the number of decimal places to be used... - $rs .= "<${typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, 128, '.', '')) . ""; + $rs .= "<${typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . ""; break; case static::$xmlrpcDateTime: if (is_string($val)) { @@ -499,7 +499,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess * * @return \ArrayIterator */ - public function getIterator() { + public function getIterator() + { switch ($this->mytype) { case 3: return new \ArrayIterator($this->me['struct']); @@ -512,8 +513,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess } } - public function offsetSet($offset, $value) { - + public function offsetSet($offset, $value) + { switch ($this->mytype) { case 3: if (!($value instanceof \PhpXmlRpc\Value)) { @@ -552,7 +553,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess } } - public function offsetExists($offset) { + public function offsetExists($offset) + { switch ($this->mytype) { case 3: return isset($this->me['struct'][$offset]); @@ -566,7 +568,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess } } - public function offsetUnset($offset) { + public function offsetUnset($offset) + { switch ($this->mytype) { case 3: unset($this->me['struct'][$offset]); @@ -582,7 +585,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess } } - public function offsetGet($offset) { + public function offsetGet($offset) + { switch ($this->mytype) { case 3: return isset($this->me['struct'][$offset]) ? $this->me['struct'][$offset] : null;