src/Collection/Tree/RedBlackSearchTree.php
protected function rotateLeft(RedBlackNode $node): RedBlackNode
    {
        $link = $node->right();
        $node->setRight($link->left());
        $link->setLeft($node);
        $link->setColor($node->color());
        $node->setColor(RedBlackNode::RED);
        $link->setSize($node->size());
        $node->setSize(1 + $this->nodeSize($node->left()) + $this->nodeSize($node->right()));

        return $link;
    }
protected function rotateLeft(RedBlackNode $node): RedBlackNode
    {
        $link = $node->right();
        $node->setRight($link->left());
        $link->setLeft($node);
        $link->setColor($node->color());
        $node->setColor(RedBlackNode::RED);
        $link->setSize($node->size());
        $node->setSize(1 + $this->nodeSize($node->left()) + $this->nodeSize($node->right()));

        return $link;
    }
protected function rotateLeft ( RedBlackNode $ node ) : RedBlackNode { $ link = $ node -> right ( ) ; $ node -> setRight ( $ link -> left ( ) ) ; $ link -> setLeft ( $ node ) ; $ link -> setColor ( $ node -> color ( ) ) ; $ node -> setColor ( RedBlackNode :: RED ) ; $ link -> setSize ( $ node -> size ( ) ) ; $ node -> setSize ( 1 + $ this -> nodeSize ( $ node -> left ( ) ) + $ this -> nodeSize ( $ node -> right ( ) ) ) ; return $ link ; }
Rotates a right-learning link to the left

Assumes $node->right is red.

@param RedBlackNode $node The node

@return RedBlackNode
Rotates a right - learning link to the left