Mercurial > hg > isophonics-drupal-site
comparison vendor/zendframework/zend-stdlib/src/ArrayObject.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
comparison
equal
deleted
inserted
replaced
11:bfffd8d7479a | 12:7a779792577d |
---|---|
178 * @param array|ArrayObject $data | 178 * @param array|ArrayObject $data |
179 * @return array | 179 * @return array |
180 */ | 180 */ |
181 public function exchangeArray($data) | 181 public function exchangeArray($data) |
182 { | 182 { |
183 if (!is_array($data) && !is_object($data)) { | 183 if (! is_array($data) && ! is_object($data)) { |
184 throw new Exception\InvalidArgumentException('Passed variable is not an array or object, using empty array instead'); | 184 throw new Exception\InvalidArgumentException( |
185 'Passed variable is not an array or object, using empty array instead' | |
186 ); | |
185 } | 187 } |
186 | 188 |
187 if (is_object($data) && ($data instanceof self || $data instanceof \ArrayObject)) { | 189 if (is_object($data) && ($data instanceof self || $data instanceof \ArrayObject)) { |
188 $data = $data->getArrayCopy(); | 190 $data = $data->getArrayCopy(); |
189 } | 191 } |
190 if (!is_array($data)) { | 192 if (! is_array($data)) { |
191 $data = (array) $data; | 193 $data = (array) $data; |
192 } | 194 } |
193 | 195 |
194 $storage = $this->storage; | 196 $storage = $this->storage; |
195 | 197 |
288 * @return mixed | 290 * @return mixed |
289 */ | 291 */ |
290 public function &offsetGet($key) | 292 public function &offsetGet($key) |
291 { | 293 { |
292 $ret = null; | 294 $ret = null; |
293 if (!$this->offsetExists($key)) { | 295 if (! $this->offsetExists($key)) { |
294 return $ret; | 296 return $ret; |
295 } | 297 } |
296 $ret =& $this->storage[$key]; | 298 $ret =& $this->storage[$key]; |
297 | 299 |
298 return $ret; | 300 return $ret; |