protected function fix(\DOMNode $node, $value)
    {
        $fixed = $value;
        if ($node instanceof \DOMText) {
            $fixed = str_replace("\n", '', $fixed);
            $fixed = preg_replace('/\s+/u', ' ', $fixed);
            $fixed = str_replace('<', '&lt;', $fixed);
            $fixed = str_replace('>', '&gt;', $fixed);
        }

        return $fixed;
    }
protected function fix(\DOMNode $node, $value)
    {
        $fixed = $value;
        if ($node instanceof \DOMText) {
            $fixed = str_replace("\n", '', $fixed);
            $fixed = preg_replace('/\s+/u', ' ', $fixed);
            $fixed = str_replace('<', '&lt;', $fixed);
            $fixed = str_replace('>', '&gt;', $fixed);
        }

        return $fixed;
    }
protected function fix ( \ DOMNode $ node , $ value ) { $ fixed = $ value ; if ( $ node instanceof \ DOMText ) { $ fixed = str_replace ( "\n" , '' , $ fixed ) ; $ fixed = preg_replace ( '/\s+/u' , ' ' , $ fixed ) ; $ fixed = str_replace ( '<' , '&lt;' , $ fixed ) ; $ fixed = str_replace ( '>' , '&gt;' , $ fixed ) ; } return $ fixed ; }
Fix given value based on node type

@param \DOMNode $node
@param string $value
@return string
Fix given value based on node type