public function setOption($name, $value)
    {
        if (is_string($name)) {
            if (isset($this->options[$name])) {
                switch ($name) {
                    case self::OPTION_STYLE_TAG:
                        if (is_int($value)) {
                            if (!in_array($value, [
                                self::OPTION_STYLE_TAG_BODY,
                                self::OPTION_STYLE_TAG_HEAD,
                                self::OPTION_STYLE_TAG_REMOVE,
                            ])) {
                                throw new \InvalidArgumentException("Invalid value '$value' for option '$name'.");
                            }
                        } else {
                            throw new \InvalidArgumentException(
                                "Invalid type '" . gettype($value) . "' for value of option '$name'."
                            );
                        }
                        break;
                    case self::OPTION_HTML_CLASSES:
                        if (is_int($value)) {
                            if (!in_array($value, [
                                self::OPTION_HTML_CLASSES_REMOVE,
                                self::OPTION_HTML_CLASSES_KEEP,
                            ])) {
                                throw new \InvalidArgumentException("Invalid value '$value' for option '$name'.");
                            }
                        } else {
                            throw new \InvalidArgumentException(
                                "Invalid type '" . gettype($value) . "' for value of option '$name'."
                            );
                        }
                        break;
                    case self::OPTION_HTML_COMMENTS:
                        if (is_int($value)) {
                            if (!in_array($value, [
                                self::OPTION_HTML_COMMENTS_REMOVE,
                                self::OPTION_HTML_COMMENTS_KEEP,
                            ])) {
                                throw new \InvalidArgumentException("Invalid value '$value' for option '$name'.");
                            }
                        } else {
                            throw new \InvalidArgumentException(
                                "Invalid type '" . gettype($value) . "' for value of option '$name'."
                            );
                        }
                        break;
                    case self::OPTION_TEXT_LINE_WIDTH:
                        if (is_int($value)) {
                            if ($value <= 0) {
                                throw new \LengthException(
                                    "Value '" . gettype($value) . "' for option '$name' is to small."
                                );
                            }
                        } else {
                            throw new \InvalidArgumentException(
                                "Invalid type '" . gettype($value) . "' for value of option '$name'."
                            );
                        }
                        break;
                    case self::OPTION_CSS_WRITER_CLASS:
                        if (is_string($value)) {
                            if (is_subclass_of($value, '\Crossjoin\Css\Writer\WriterAbstract', true) === false) {
                                throw new \InvalidArgumentException(
                                    "Invalid value '$value' for option '$name'. " .
                                    "The given class has to be a subclass of \\Crossjoin\\Css\\Writer\\WriterAbstract."
                                );
                            }
                        } else {
                            throw new \InvalidArgumentException(
                                "Invalid type '" . gettype($value) . "' for value of option '$name'."
                            );
                        }
                }
                $this->options[$name] = $value;
            } else {
                throw new \InvalidArgumentException("An option with the name '$name' doesn't exist.");
            }
        } else {
            throw new \InvalidArgumentException("Invalid type '" . gettype($name) . "' for argument 'name'.");
        }
    }