Code Duplication    Length = 16-19 lines in 2 locations

src/SortedCollection/TreeNode.php 2 locations

@@ 485-500 (lines=16) @@
482
483
		if ($cmp < 0)
484
		{
485
			if ($this->information & 2)
486
			{
487
				$leftBalance = $this->left->information & ~3;
488
				$this->left = $this->left->insert($key, $value, $comparator);
489
490
				if (($this->left->information & ~3) && ($this->left->information & ~3) != $leftBalance)
491
				{
492
					$node = $this->_decBalance();
493
				}
494
			}
495
			else
496
			{
497
				$this->left = new static($key, $value, $this->left, $this);
498
				$this->information|= 2;
499
				$node = $this->_decBalance();
500
			}
501
		}
502
		elseif ($cmp > 0)
503
		{
@@ 502-520 (lines=19) @@
499
				$node = $this->_decBalance();
500
			}
501
		}
502
		elseif ($cmp > 0)
503
		{
504
			if ($this->information & 1)
505
			{
506
				$rightBalance = $this->right->information & ~3;
507
				$this->right = $this->right->insert($key, $value, $comparator);
508
509
				if (($this->right->information & ~3) && ($this->right->information & ~3) != $rightBalance)
510
				{
511
					$node = $this->_incBalance();
512
				}
513
			}
514
			else
515
			{
516
				$this->right = new static($key, $value, $this, $this->right);
517
				$this->information|= 1;
518
				$node = $this->_incBalance();
519
			}
520
		}
521
		else
522
		{
523
			$this->value = $value;