protected function signElement(DOMElement $root, DOMNode $insertBefore = null) : ?DOMElement
    {
        if ($this->signatureKey === null) {
            /* We cannot sign this element. */
            return null;
        }

        Utils::insertSignature($this->signatureKey, $this->certificates, $root, $insertBefore);

        return $root;
    }
protected function signElement(DOMElement $root, DOMNode $insertBefore = null) : ?DOMElement
    {
        if ($this->signatureKey === null) {
            /* We cannot sign this element. */
            return null;
        }

        Utils::insertSignature($this->signatureKey, $this->certificates, $root, $insertBefore);

        return $root;
    }
protected function signElement ( DOMElement $ root , DOMNode $ insertBefore = null ) : ? DOMElement { if ( $ this -> signatureKey === null ) { /* We cannot sign this element. */ return null ; } Utils :: insertSignature ( $ this -> signatureKey , $ this -> certificates , $ root , $ insertBefore ) ; return $ root ; }
Sign the given XML element.

@param \DOMElement $root The element we should sign.
@param \DOMNode|null $insertBefore The element we should insert the signature node before.
@return \DOMElement|null
Sign the given XML element .