Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NamedParameterMap.php

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\Map

Code

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;
}
RSS feed
Powered by Drupal