/** * Merge two text nodes by concatenating their content. * * /!\ Text contexts are lost in the process * * @param TextNode $a First node * @param TextNode $b The other one * @return TextNode Merged text node */ public static function merge(TextNode $a, TextNode $b) { return new self(sprintf('%s%s', $a->getValue(), $b->getValue())); }