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

removeNodesWithNegativeScores() private method

if there are elements inside our top node that have a negative gravity score, let's give em the boot
private removeNodesWithNegativeScores ( DOMWrap\Element $topNode )
$topNode DOMWrap\Element
    private function removeNodesWithNegativeScores(Element $topNode)
    {
        if (!empty($topNode)) {
            $gravityItems = $topNode->find('*[gravityScore]');
            foreach ($gravityItems as $item) {
                $score = (int) $item->attr('gravityScore');
                if ($score < 1) {
                    $item->remove();
                }
            }
        }
    }