private function rotateLeft(BinaryTree $t) { if ($t->right()->isEmpty()) { return $t; } return new self($t->right()->key(), $t->right()->value(), $t->right()->left(), new self($t->key(), $t->value(), $t->left(), $t->right()->left())); }