{$offset}); } #[\ReturnTypeWillChange] public function offsetGet($offset) { return $this->{$offset}; } /** * @throws BadMethodCallException */ public function offsetSet($offset, $value) : void { throw new BadMethodCallException('Cannot set options through array access. Use the setters instead'); } /** * @throws BadMethodCallException */ public function offsetUnset($offset) : void { throw new BadMethodCallException('Cannot unset options through array access. Use the setters instead'); } public function toArray() : array { $arr = []; foreach (\get_object_vars($this) as $key => $value) { $arr[$key] = $value; } return $arr; } }