public function offsetSet($offset, $value)
    {
        if ($offset === '' || $offset === null) {
            throw new \InvalidArgumentException('The key of a collection must always be set');
        }

        $this->items[$offset] = $value;
    }
public function offsetSet($offset, $value)
    {
        if ($offset === '' || $offset === null) {
            throw new \InvalidArgumentException('The key of a collection must always be set');
        }

        $this->items[$offset] = $value;
    }
public function offsetSet ( $ offset , $ value ) { if ( $ offset === '' || $ offset === null ) { throw new \ InvalidArgumentException ( 'The key of a collection must always be set' ) ; } $ this -> items [ $ offset ] = $ value ; }
Sets an item at the given index.

@param string|integer $offset The offset to assign the value to.
@param mixed          $value  The value to set.

@throws \InvalidArgumentException if the key is null or an empty string.
Sets an item at the given index .