X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fdrupal%2Fconsole-core%2Fsrc%2FUtils%2FKeyValueStorage.php;fp=vendor%2Fdrupal%2Fconsole-core%2Fsrc%2FUtils%2FKeyValueStorage.php;h=d8ef7a3a2b32955fdf1605030bd4ef4c687eda8e;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=0000000000000000000000000000000000000000;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/vendor/drupal/console-core/src/Utils/KeyValueStorage.php b/vendor/drupal/console-core/src/Utils/KeyValueStorage.php new file mode 100644 index 000000000..d8ef7a3a2 --- /dev/null +++ b/vendor/drupal/console-core/src/Utils/KeyValueStorage.php @@ -0,0 +1,69 @@ +data); + } + + /** + * Gets the given key from the container, or returns the default if it does + * not exist. + * + * @param string $key + * The key to get. + * @param mixed $default + * Default value to return. + * + * @return mixed + */ + public function get($key, $default = null) + { + return $this->has($key) ? $this->data[$key] : $default; + } + + /** + * Sets the given key in the container. + * + * @param mixed $key + * The key to set + * @param mixed $value + * The value. + */ + public function set($key, $value = null) + { + $this->data[$key] = $value; + } + + /** + * Removes the given key from the container. + * + * @param string $key The key to forget. + * + * @return void + */ + public function remove($key) + { + unset($this->data[$key]); + } + +}