From c479658f0bb953ded4b29ca573404a318f1e798f Mon Sep 17 00:00:00 2001 From: EoleDev Date: Wed, 9 Mar 2016 15:36:02 +0100 Subject: New Library --- .../common/src/Common/ArrayAccessTrait.php | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 server/vendor/php-opencloud/common/src/Common/ArrayAccessTrait.php (limited to 'server/vendor/php-opencloud/common/src/Common/ArrayAccessTrait.php') diff --git a/server/vendor/php-opencloud/common/src/Common/ArrayAccessTrait.php b/server/vendor/php-opencloud/common/src/Common/ArrayAccessTrait.php new file mode 100644 index 0000000..72bcfce --- /dev/null +++ b/server/vendor/php-opencloud/common/src/Common/ArrayAccessTrait.php @@ -0,0 +1,67 @@ +internalState[] = $value; + } else { + $this->internalState[$offset] = $value; + } + } + + /** + * Checks whether an internal key exists. + * + * @param string $offset + * + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->internalState[$offset]); + } + + /** + * Unsets an internal key. + * + * @param string $offset + */ + public function offsetUnset($offset) + { + unset($this->internalState[$offset]); + } + + /** + * Retrieves an internal key. + * + * @param string $offset + * + * @return mixed|null + */ + public function offsetGet($offset) + { + return $this->offsetExists($offset) ? $this->internalState[$offset] : null; + } +} -- cgit v1.2.3