Code Duplication    Length = 7-8 lines in 3 locations

DataStructures/Trees/BinaryTreeAbstract.php 3 locations

@@ 68-75 (lines=8) @@
65
            $parentNode = &$current;
66
            if($key < $current->key) {
67
                $current = &$current->left;
68
            } else if($key > $current->key) {
69
                $current = &$current->right;
70
            } else {
71
                if($update) {
72
                    $current->data = $data;
73
                }
74
                return;
75
            }
76
        }
77
78
        $newNode->parent = &$parentNode;
@@ 149-155 (lines=7) @@
146
        } else {
147
            $node = $this->root;
148
            while($node !== null) {
149
                if($key < $node->key) {
150
                    $node = $node->left;
151
                } else if($key > $node->key) {
152
                    $node = $node->right;
153
                } else {
154
                    return true;
155
                }
156
            }
157
        }
158
@@ 395-401 (lines=7) @@
392
        } else {
393
            $node = $this->root;
394
            while($node !== null) {
395
                if($key < $node->key) {
396
                    $node = $node->left;
397
                } else if($key > $node->key) {
398
                    $node = $node->right;
399
                } else {
400
                    return $node;
401
                }
402
            }
403
        }
404