@param mixed $key

@return mixed

@throws OutOfBoundsException if $key does not exist in the array
499205
public function get($key)
    {
        if (func_num_args() === 1 && !$this->has($key)) {
            throw new OutOfBoundsException(sprintf('This ArrayItem has no element with key "%s".', $key));
        } elseif (func_num_args() === 2) {
            return func_get_arg(1);
        }

        return $this->data[$key];
    }
1192704
public function get($key)
    {
        $config = $this->getConfig();
        if (! array_key_exists($key, $config)) {
            throw new \OutOfRangeException(sprintf(self::ERR_INVALID_CONFIG_KEY, $key));
        }
        return $config[$key];
    }
1006334
public function normalizeKey($key)
	{
		$normalizedKey = filter_var(
			(preg_match('(^-\\d+$)D', $key)) ? count($this->items) + $key : $key,
			FILTER_VALIDATE_INT,
			[
				'options' => [
					'min_range' => 0,
					'max_range' => count($this->items)
				]
			]
		);

		if ($normalizedKey === false)
		{
			throw new InvalidArgumentException("Invalid offset '" . $key . "'");
		}

		return $normalizedKey;
	}
119697
public function get(string $id)
    {
        if (!isset($this->values[$id])) {
            throw new OutOfBoundsException("Value {$id} is not defined in the container");
        }
        if ($this->values[$id] instanceof Closure) {
            return $this->values[$id]($this);
        }

        return $this->values[$id];
    }
383366
public function getCount($primaryKey)
    {
        if (!isset($this->values[$primaryKey])) {
            throw new OutOfBoundsException(sprintf(
                'The key "%s" does not exist.',
                $primaryKey
            ));
        }

        return count($this->values[$primaryKey]);
    }
151663
public function get(string $data)
    {
        $entry = $this->data->get($data);

        if (is_null($entry)) {
            throw new \OutOfBoundsException("{$entry} is a invalid key for closure shared data");
        }

        return $entry;
    }
708303
public function take($key)
    {
        self::requireSession();
        if (false === \array_key_exists($key, $_SESSION)) {
            throw new SessionException(\sprintf('key "%s" not found in session', $key));
        }
        $value = $_SESSION[$key];
        unset($_SESSION[$key]);

        return $value;
    }
148206
public function getIssueByKey($key)
    {
        if (array_key_exists($key, $this->issues) && isset($this->issues[$key])) {
            return $this->issues[$key];
        }

        return null;
    }
793724
public function llen($key) {

        $value = $this->get($key, array());

        return is_array($value) ? count($value):0;
    }
445187
public function _get($key)
    {
        $value = parent::_get($key);

        try {
            return $this->_dereferenceTokens($value);
        } catch (RuntimeException $e) {
            throw $this->_createContainerException($this->__('Could not de-reference tokens'), null, $e, $this);
        }
    }
296093
public function getConstant($key)
    {
        $returnValue = null;

        $constants = $this->getConstants();
        if (isset($constants[$key])) {
        	$returnValue = $constants[$key];
        } elseif (defined($key)) {
        	common_logger::w('constant outside of extension called: '.$key);
        	$returnValue = constant($key);
        } else {
        	throw new common_exception_Error('Unknown constant \''.$key.'\' for extension '.$this->id);
        }

        return $returnValue;
    }
377466
public function isLast($key)
	{
		if ($this->rows && $this->count())
		{
			return $key == array_slice($this->rows, -1, 1)[0]->getPkValue();
		}

		return false;
	}
1231483
public function find($key)
    {
        if ($this->root) {
            $find = $this->root->find($key, $this->comparator, 0);
        } else {
            $find = null;
        }

        if ($find) {
            return $find;
        } else {
            throw new \OutOfBoundsException('Element unexisting');
        }
    }
603854
public function getFirst($primaryKey)
    {
        if (!isset($this->values[$primaryKey])) {
            throw new OutOfBoundsException(sprintf(
                'The key "%s" does not exist.',
                $primaryKey
            ));
        }

        return reset($this->values[$primaryKey]);
    }
994831
public function offsetGet($offset)
    {
        if (! $this->offsetExists($offset)) {
            throw new \OutOfBoundsException(
                sprintf(
                    'Key %s does not exists',
                    $offset
                )
            );
        }

        return $this->data[$offset];
    }
143779
public function offsetGet($key)
    {
        if(array_key_exists($key, $this->resolved)) {
            return $this->resolved[$key];
        }

        return $this->make($key);
    }
609836
public function offsetGet($offset)
	{
		if(empty($this->tokens[$offset]))
		{
			throw new \OutOfBoundsException('No token found at offset ' . $offset);
		}

		return $this->tokens[$offset];
	}