/** * @param mixed $offset * @param mixed $value * @param mixed */ public function offsetSet($offset, $value) { $valueOffset = $this->offsetMethod->invoke($value, $this->offsetArgs); $this->checkValue($value); if (!is_null($offset) && $offset !== $valueOffset) { throw new \InvalidArgumentException(); } return parent::offsetSet($valueOffset, $value); }