/** * @param $key * @param $value * * @return $this|null * @throws ContextMutabilityError */ public function set($key, $value) { if (!$this->mutable($key)) { throw new ContextMutabilityError("Index `{$key}` is immutable."); } # attempt writing the value to the key if (is_string($key)) { list($key, $value) = Arr::expand_notated($key, $value); return $this->search([$key => $value]); } return NULL; }
/** * @param $key * @param $value * * @return $this|null */ public function set($key, $value) { # attempt writing the value to the key if (is_string($key)) { list($key, $value) = Arr::expand_notated($key, $value); return $this->search([$key => $value]); } return NULL; }