protected function addClass(\DOMElement $element, $class)
    {
        if ($element->hasAttribute('class')) {
            $element->setAttribute('class', $element->getAttribute('class') . ' ' . $class);
        } else {
            $element->setAttribute('class', $class);
        }
    }
protected function addClass(\DOMElement $element, $class)
    {
        if ($element->hasAttribute('class')) {
            $element->setAttribute('class', $element->getAttribute('class') . ' ' . $class);
        } else {
            $element->setAttribute('class', $class);
        }
    }
protected function addClass ( \ DOMElement $ element , $ class ) { if ( $ element -> hasAttribute ( 'class' ) ) { $ element -> setAttribute ( 'class' , $ element -> getAttribute ( 'class' ) . ' ' . $ class ) ; } else { $ element -> setAttribute ( 'class' , $ class ) ; } }
Add a class to an element

@param string $class
Add a class to an element