Fix offsetSet and offsetUnset in Collection

2.x 2.0.1
Julien Rosset 3 years ago
parent 80dd6d3545
commit 4b7e60c003

@ -50,4 +50,17 @@ class Collection extends ImmutableCollection implements ICollection {
}
return $this;
}
/**
* @inheritDoc
*/
public function offsetSet ($offset, $value): void {
$this->set($offset, $value);
}
/**
* @inheritDoc
*/
public function offsetUnset ($offset): void {
$this->remove($offset);
}
}

@ -128,13 +128,13 @@ class ImmutableCollection implements IImmutableCollection {
/**
* @inheritDoc
*/
public function offsetSet ($offset, $value) {
public function offsetSet ($offset, $value): void {
throw new ImmutableException();
}
/**
* @inheritDoc
*/
public function offsetUnset ($offset) {
public function offsetUnset ($offset): void {
throw new ImmutableException();
}

Loading…
Cancel
Save