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)));
    }
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)));
    }
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 ) ) ) ; }
Adds the class to the dom element.

@param \DOMElement     $element
@param string|string[] $classes
Adds the class to the dom element .