public function inlineCssOnElement(\DOMElement $element, array $properties)
    {
        if (empty($properties)) {
            return $element;
        }

        $cssProperties = array();
        $inlineProperties = array();

        foreach ($this->getInlineStyles($element) as $property) {
            $inlineProperties[$property->getName()] = $property;
        }

        foreach ($properties as $property) {
            if (!isset($inlineProperties[$property->getName()])) {
                $cssProperties[$property->getName()] = $property;
            }
        }

        $rules = array();
        foreach (array_merge($cssProperties, $inlineProperties) as $property) {
            $rules[] = $property->toString();
        }
        $element->setAttribute('style', implode(' ', $rules));

        return $element;
    }
public function inlineCssOnElement(\DOMElement $element, array $properties)
    {
        if (empty($properties)) {
            return $element;
        }

        $cssProperties = array();
        $inlineProperties = array();

        foreach ($this->getInlineStyles($element) as $property) {
            $inlineProperties[$property->getName()] = $property;
        }

        foreach ($properties as $property) {
            if (!isset($inlineProperties[$property->getName()])) {
                $cssProperties[$property->getName()] = $property;
            }
        }

        $rules = array();
        foreach (array_merge($cssProperties, $inlineProperties) as $property) {
            $rules[] = $property->toString();
        }
        $element->setAttribute('style', implode(' ', $rules));

        return $element;
    }
public function inlineCssOnElement ( \ DOMElement $ element , array $ properties ) { if ( empty ( $ properties ) ) { return $ element ; } $ cssProperties = array ( ) ; $ inlineProperties = array ( ) ; foreach ( $ this -> getInlineStyles ( $ element ) as $ property ) { $ inlineProperties [ $ property -> getName ( ) ] = $ property ; } foreach ( $ properties as $ property ) { if ( ! isset ( $ inlineProperties [ $ property -> getName ( ) ] ) ) { $ cssProperties [ $ property -> getName ( ) ] = $ property ; } } $ rules = array ( ) ; foreach ( array_merge ( $ cssProperties , $ inlineProperties ) as $ property ) { $ rules [ ] = $ property -> toString ( ) ; } $ element -> setAttribute ( 'style' , implode ( ' ' , $ rules ) ) ; return $ element ; }
Inline the given properties on an given DOMElement

@param \DOMElement             $element
@param Css\Property\Property[] $properties
@return \DOMElement
Inline the given properties on an given DOMElement