4 namespace Drupal\Console\Core\Utils;
16 * Checks if the container has the given key.
23 public function has($key)
25 return array_key_exists($key, $this->data);
29 * Gets the given key from the container, or returns the default if it does
34 * @param mixed $default
35 * Default value to return.
39 public function get($key, $default = null)
41 return $this->has($key) ? $this->data[$key] : $default;
45 * Sets the given key in the container.
52 public function set($key, $value = null)
54 $this->data[$key] = $value;
58 * Removes the given key from the container.
60 * @param string $key The key to forget.
64 public function remove($key)
66 unset($this->data[$key]);