src/ImmutableCollection.php
final public function offsetSet($index, $value): void
    {
        if (is_null($index)) {
            throw CannotAlterCollection::byAddingTo($this);
        }
        throw CannotAlterCollection::byOverWriting($this, $index);
    }
final public function offsetSet($index, $value): void
    {
        if (is_null($index)) {
            throw CannotAlterCollection::byAddingTo($this);
        }
        throw CannotAlterCollection::byOverWriting($this, $index);
    }
final public function offsetSet ( $ index , $ value ) : void { if ( is_null ( $ index ) ) { throw CannotAlterCollection :: byAddingTo ( $ this ) ; } throw CannotAlterCollection :: byOverWriting ( $ this , $ index ) ; }
Disallows use of the offsetSet method.

@param int|mixed $index The index that may not be mutated.
@param mixed     $value The value that will not be written.
@throws NotAllowed      Whenever called upon.
Disallows use of the offsetSet method .