Goose\Modules\Formatters\OutputFormatter::addSiblings PHP Method

addSiblings() private method

private addSiblings ( DOMWrap\Element $topNode )
$topNode DOMWrap\Element
    private function addSiblings(Element $topNode)
    {
        $baselineScoreForSiblingParagraphs = $this->getBaselineScoreForSiblings($topNode);
        $previousSiblings = $topNode->precedingAll(function ($node) {
            return $node instanceof Element;
        });
        // Find all previous sibling element nodes
        foreach ($previousSiblings as $siblingNode) {
            $results = $this->getSiblingContent($siblingNode, $baselineScoreForSiblingParagraphs);
            foreach ($results as $result) {
                $topNode->insertBefore($result, $topNode->firstChild);
            }
        }
    }