public function minify($options = [])
    {
        $resolver = new OptionsResolver();
        $resolver->setDefaults([
            'minify_js' => $this->options['minify_js'],
            'minify_css' => $this->options['minify_css'],
            'remove_comments' => $this->options['remove_comments'],
            'remove_empty_attributes' => $this->options['remove_empty_attributes']
        ]);
        $options = $resolver->resolve($options);

        if ($options['minify_js']) {
            $this->minifyJavascript();
        }
        if ($options['minify_css']) {
            $this->minifyCss();
        }
        if ($options['remove_comments']) {
            $this->removeComments();
        }

        if ($options['remove_empty_attributes']) {
            $this->removeEmptyAttributes();
        }

        $this->removeWhitespace();

        return $this;
    }