X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2FValue.php;h=f51579b3deec1648857afb756822dca6fc6047cd;hb=7fbd194478e080d624bab075d189bf3ba215325d;hp=8747e69f2e8a9a9a98ce9e371f0c2127c47bd29e;hpb=ac735cf96eb914759f7e7595630857254b599783;p=plcapi.git diff --git a/src/Value.php b/src/Value.php index 8747e69..f51579b 100644 --- a/src/Value.php +++ b/src/Value.php @@ -296,6 +296,7 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess $rs .= "\n"; } $charsetEncoder = Charset::instance(); + /** @var Value $val2 */ foreach ($val as $key2 => $val2) { $rs .= '' . $charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "\n"; //$rs.=$this->serializeval($val2); @@ -307,6 +308,7 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess case 2: // array $rs .= "\n\n"; + /** @var Value $element */ foreach ($val as $element) { //$rs.=$this->serializeval($val[$i]); $rs .= $element->serialize($charsetEncoding); @@ -348,6 +350,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess */ public function structmemexists($key) { + //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED); + return array_key_exists($key, $this->me['struct']); } @@ -363,6 +367,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess */ public function structmem($key) { + //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED); + return $this->me['struct'][$key]; } @@ -372,6 +378,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess */ public function structreset() { + //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED); + reset($this->me['struct']); } @@ -384,7 +392,9 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess */ public function structeach() { - return each($this->me['struct']); + //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED); + + return @each($this->me['struct']); } /** @@ -428,6 +438,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess */ public function arraymem($key) { + //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED); + return $this->me['array'][$key]; } @@ -440,6 +452,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess */ public function arraysize() { + //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED); + return count($this->me['array']); } @@ -452,6 +466,8 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess */ public function structsize() { + //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED); + return count($this->me['struct']); } @@ -480,7 +496,7 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess /** * Implements the IteratorAggregate interface * - * @return ArrayIterator + * @return \ArrayIterator */ public function getIterator() { switch ($this->mytype) { @@ -493,7 +509,6 @@ class Value implements \Countable, \IteratorAggregate, \ArrayAccess default: return new \ArrayIterator(); } - return new \ArrayIterator(); } public function offsetSet($offset, $value) {