public function set($key, $value = null)
    {
        if (\is_array($key) && $value === null) {
            $this->items = $key;
            trigger_error('Replacing collection contents via set is deprecated', E_USER_DEPRECATED);
        } else {
            $this->offsetSet($key, $value);
        }

        return $this;
    }