public static function removeOrphan(array &$nodes = []) {
        do {
            $found = false;
            foreach ($nodes as $k => $v) {
                if (false === ($v instanceof AlphabeticalTreeNodeInterface) || null === $v->getAlphabeticalTreeNodeParent() || true === in_array($v->getAlphabeticalTreeNodeParent(), $nodes)) {
                    continue;
                }
                unset($nodes[$k]);
                $found = true;
            }
        } while (true === $found);
    }
public static function removeOrphan(array &$nodes = []) {
        do {
            $found = false;
            foreach ($nodes as $k => $v) {
                if (false === ($v instanceof AlphabeticalTreeNodeInterface) || null === $v->getAlphabeticalTreeNodeParent() || true === in_array($v->getAlphabeticalTreeNodeParent(), $nodes)) {
                    continue;
                }
                unset($nodes[$k]);
                $found = true;
            }
        } while (true === $found);
    }
public static function removeOrphan ( array & $ nodes = [ ] ) { do { $ found = false ; foreach ( $ nodes as $ k => $ v ) { if ( false === ( $ v instanceof AlphabeticalTreeNodeInterface ) || null === $ v -> getAlphabeticalTreeNodeParent ( ) || true === in_array ( $ v -> getAlphabeticalTreeNodeParent ( ) , $ nodes ) ) { continue ; } unset ( $ nodes [ $ k ] ) ; $ found = true ; } } while ( true === $ found ) ; }
Remove orphan.

@param AlphabeticalTreeNodeInterface[] $nodes The nodes.
@return void
Remove orphan .