static public function addClass(\DOMElement $element, $classes)
    {
        if (!is_array($classes)) {
            $classes = [$classes];
        }

        $c = explode(' ', (string)$element->getAttribute('class'));

        foreach ($classes as $n) {
            if (empty($n)) {
                continue;
            }
            if (!in_array($n, $c, true)) {
                $c[] = $n;
            }
        }

        $element->setAttribute('class', trim(implode(' ', $c)));
    }