src/Collection/Tree/RedBlackSearchTree.php
protected function nodeRemoveMin(RedBlackNode $node): ?RedBlackNode
    {
        if ($node->left() === null) {
            return null;
        }

        if (!$this->isRed($node->left()) && !$this->isRed($node->left()->left())) {
            $node = $this->moveRedLeft($node);
        }

        $node->setLeft($this->nodeRemoveMin($node->left()));

        return $this->balanceOnRemove($node);
    }
protected function nodeRemoveMin(RedBlackNode $node): ?RedBlackNode
    {
        if ($node->left() === null) {
            return null;
        }

        if (!$this->isRed($node->left()) && !$this->isRed($node->left()->left())) {
            $node = $this->moveRedLeft($node);
        }

        $node->setLeft($this->nodeRemoveMin($node->left()));

        return $this->balanceOnRemove($node);
    }
protected function nodeRemoveMin ( RedBlackNode $ node ) : ? RedBlackNode { if ( $ node -> left ( ) === null ) { return null ; } if ( ! $ this -> isRed ( $ node -> left ( ) ) && ! $ this -> isRed ( $ node -> left ( ) -> left ( ) ) ) { $ node = $ this -> moveRedLeft ( $ node ) ; } $ node -> setLeft ( $ this -> nodeRemoveMin ( $ node -> left ( ) ) ) ; return $ this -> balanceOnRemove ( $ node ) ; }
Removes the node with the minimum key in a subtree

@param RedBlackNode $node The subtree root

@return RedBlackNode|null
Removes the node with the minimum key in a subtree