protected function setOption($name, $value, $reset = false) {
        $changed = !isset($this->options[$name]) || $this->options[$name] !== $value;

        if ($changed && $reset) {
            $this->data = null;
        }

        $this->options[$name] = $value;
        return $this;
    }