function NamedParameterMap::offsetSet
Overrides AbstractMap::offsetSet
File
-
vendor/
ramsey/ collection/ src/ Map/ NamedParameterMap.php, line 65
Class
- NamedParameterMap
- `NamedParameterMap` represents a mapping of values to a set of named keys that may optionally be typed
Namespace
Ramsey\Collection\MapCode
public function offsetSet(mixed $offset, mixed $value) : void {
if (!array_key_exists($offset, $this->namedParameters)) {
throw new InvalidArgumentException('Attempting to set value for unconfigured parameter \'' . $this->toolValueToString($offset) . '\'');
}
if ($this->checkType($this->namedParameters[$offset], $value) === false) {
throw new InvalidArgumentException('Value for \'' . $offset . '\' must be of type ' . $this->namedParameters[$offset] . '; value is ' . $this->toolValueToString($value));
}
$this->data[$offset] = $value;
}