public function config($option = null, $value = null)
    {
        if ($option !== null) {
            self::ensureValidConfigOptions($option);

            if (!is_array($option)) {
                if ($value !== null) {
                    $this->config[$option] = $value;
                }
                return array_key_exists($option, $this->config) ? $this->config[$option] : null;
            }
            $this->config = $option;
        }
        return $this->config;
    }