public function setOption($name, $value) { if (!array_key_exists($name, $this->options)) { throw new \InvalidArgumentException("{$name} is not a valid option name.", 3); } $this->options[$name] = $value; return $this; }