public function offsetSet($key, $value)
{
$this->displayWarning();
if (is_object($this->object) && !$this->object instanceof \ArrayAccess) {
$this->object->{$key} = $value;
} else {
if ($key === null) {
// Yes this is necessary. Otherwise $key will be interpreted as empty string
$this->object[] = $value;
} else {
$this->object[$key] = $value;
}
}
}