/** * Set value by key * * @param int|string $key * @param mixed $value * * @throws \InvalidArgumentException * @return $this */ public function set($key, $value = null) { $this->check(); if (!Arrays::isArray($key)) { $key = array($key => $value); } foreach ($key as $k => $v) { Arrays::setPath($this->data, $k, $v); } $this->encode(); return $this; }
/** * Added support of array with mapped options names/bits as keys and booleans as values * * {@inheritdoc} */ public function push($value) { if (Arrays::isArray($value)) { if (Arrays::isAssoc($value)) { $this->setAll($value); } else { $this->clear()->apply($value); } } else { parent::push($value); } return $this; }