Do not allow to set more definitions.

@param mixed $key
@param mixed $newval
@return void
194346
public function offsetSet($key, $newval)
    {
        if ($def = in_array($key, array_keys($this->keys))) {
            parent::offsetSet($key, $newval);
        } else {
            throw new UnexpectedValueException($key.' is not defined in metadata definition '.get_class($this).'.');
        }
    }
65592
public function update($key, $newvars, $oldvars)
    {
        $now = $this->db->now();
        $ts  = microtime(true);

        // if new and old data are not the same, update data
        // else update expire timestamp only when certain conditions are met
        if ($newvars !== $oldvars) {
            $this->db->query("UPDATE {$this->table_name} "
                . "SET `changed` = $now, `vars` = ? WHERE `sess_id` = ?",
                base64_encode($newvars), $key);
        }
        else if ($ts - $this->changed + $this->time_diff > $this->lifetime / 2) {
            $this->db->query("UPDATE {$this->table_name} SET `changed` = $now"
                . " WHERE `sess_id` = ?", $key);
        }

        return true;
    }
1085904
public function setStorageValue($value, $key = false) {
        $key = (!$key ? $this->name."InputResult" : $key);
        $this->getStorageContainer()->set($key, $value);
    }
1335159
public function offsetSet($index, $newval)
    {
        if ($newval instanceof $this->type) {
            parent::offsetSet($index, $newval);

            return;
        }

        if ($this->allowedTypes[$this->type]($newval)) {
            parent::offsetSet($index, $newval);

            return;
        }

        throw new InvalidArgumentException(__CLASS__.': Elements passed to '.__CLASS__.' must be of the type '.$this->type.'.');
    }
1185159
public function set($key, $val = null)
    {
        if (is_array($key)) {
            $this->_setpost = array_merge($this->_setpost, $key);
        } else {
            $this->_setpost[$key] = $val;
        }
        return $this;
    }
799833
public static function setContextDataByKey(string $key, $val)
    {
        $coroutineId = self::getCoroutineId();
        self::$context[$coroutineId][self::DATA_KEY][$key] = $val;
    }
800027
public function offsetSet($index, $newval)
    {
        if (!$newval instanceof TableOfContents\File) {
            throw new \InvalidArgumentException('A table of contents may only be filled with File objects');
        }

        $basename = basename($newval->getFilename());
        if (strpos($basename, '.') !== false) {
            $basename = substr($basename, 0, strpos($basename, '.'));
        }

        if (strtolower($basename) === 'index') {
            $this->modules[] = $newval;
        }

        parent::offsetSet($newval->getFilename(), $newval);
    }
935838
protected function saving(string $key, $value, bool $isNew): void
    {
        if ($value === 'N;') {
            $this->delete($key);
        } else {
            $this->save($key, $value, $isNew);
        }
    }
179688
public function rename($newKey)
    {
        $this->filesystem->rename($this->key, $newKey);

        $this->key = $newKey;
    }
447096
private function _setBool($key, $val) {
		if ($key && !$val) {
			$this->_result = preg_replace("/<if\." . $key . ">(.*?)<\/if\." . $key . ">/s", '', $this->_result);
		}
		$this->_result = str_replace("<if." . $key . ">", '', $this->_result);
		$this->_result = str_replace("</if." . $key . ">", '', $this->_result);
	}
559036
public static void setIsClonedServer(Boolean newVal) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "setIsClonedServer", newVal);
        isCloned = newVal;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "setIsClonedServer");
    }
24655
public function setAttribute($key, $val)
    {
        if(is_null($val) && array_key_exists($key, $this->attributes))
            unset($this->attributes[$key]);
        else
            $this->attributes[$key] = $val;
    }
1174536
protected function _overwrite(&$old, $new)
    {
        if (!empty($old)) {
            foreach ($old as $key => $var) {
                if (!isset($new[$key])) {
                    unset($old[$key]);
                }
            }
        }
        foreach ($new as $key => $var) {
            $old[$key] = $var;
        }
    }
1201818
public function append($newvalue) : void
    {
        $index = count((array)$this);
        $this->offsetSet($index, $newvalue);
    }
58470
public function offsetSet($index, $newval)
    {
        if ($index === null) {
            $this[] = $newval;
        } else {
            parent::offsetSet($index, $newval);
        }
    }
1216336
public function cas($key, $old_value, $new_value)
    {
        $connection = $this->getConnection($key);
        $this->writeToRemote(array(
            'cmd' => 'cas',
            'md5' => md5(serialize($old_value)),
            'key' => $key,
            'value' => $new_value,
        ), $connection);
        return $this->readFromRemote($connection);
    }
490767
protected function innerSet($key, $val)
    {
        $setMethod = 'set' . ucfirst($key);
        if ( !in_array($key, $this->notsetters()) && method_exists($this, $setMethod) ) {
            $this->$setMethod($val);
        } else {

            $validateMethod = 'validate' . ucfirst($key);

            if (method_exists($this, $validateMethod)) {

                $errors = new Exceptions();

                try {
                    $validateResult = $this->$validateMethod($val);
                    if (false === $validateResult) {
                        return;
                    }
                    if ($validateResult instanceof \Generator) {
                        foreach ($validateResult as $error) {
                            if ($error instanceof \Throwable) {
                                $errors->add($error);
                            }
                        }
                    }
                } catch (\Throwable $e) {
                    $errors->add($e);
                }

                if (!$errors->empty()) {
                    throw $errors;
                }

            }

            $sanitizeMethod = 'sanitize' . ucfirst($key);
            if (method_exists($this, $sanitizeMethod)) {
                $val = $this->$sanitizeMethod($val);
            }

            if (null === $key) {
                $this->__data[] = $val;
            } else {
                $this->__data[$key] = $val;
            }
        }
    }