src/Collection/Tree/RedBlackSearchTree.php
protected function flipColors(RedBlackNode $node): void
    {
        $node->setColor(!($node->color()));
        $node->left()->setColor(!($node->left()->color()));
        $node->right()->setColor(!($node->right()->color()));
    }
protected function flipColors(RedBlackNode $node): void
    {
        $node->setColor(!($node->color()));
        $node->left()->setColor(!($node->left()->color()));
        $node->right()->setColor(!($node->right()->color()));
    }
protected function flipColors ( RedBlackNode $ node ) : void { $ node -> setColor ( ! ( $ node -> color ( ) ) ) ; $ node -> left ( ) -> setColor ( ! ( $ node -> left ( ) -> color ( ) ) ) ; $ node -> right ( ) -> setColor ( ! ( $ node -> right ( ) -> color ( ) ) ) ; }
Flips the colors of a node and its two children

Used to maintain symmetric order and perfect black balance when a black
node has two red children.

@param RedBlackNode $node The node

@return void
Flips the colors of a node and its two children