public function setOption($key, $value) { $method = 'set' . $this->normalizeKey($key); if (method_exists($this, $method)) { $this->{$method}($value); } else { $this->options[$key] = $value; } }