Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Commit

Permalink
Introduce link() as alias of deprecated entangle()
Browse files Browse the repository at this point in the history
  • Loading branch information
younishd committed Nov 5, 2019
1 parent 75c967c commit a66448c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/endobox/Box.php
Expand Up @@ -122,7 +122,7 @@ public function __clone()
$this->interior = clone $this->interior;
$this->renderer = clone $this->renderer;

// detach the cloned box from any appended or entangled boxes
// detach the cloned box from any appended or linked boxes
$this->rank = 0;
$this->parent = $this;
$this->child = $this;
Expand Down Expand Up @@ -202,7 +202,7 @@ public function prepend(Box $b) : Box
/**
* Union by rank.
*/
public function entangle(Box $b) : Box
public function link(Box $b) : Box
{
$root1 = $this->find();
$root2 = $b->find();
Expand Down Expand Up @@ -230,6 +230,14 @@ public function entangle(Box $b) : Box
return $this;
}

/**
* Deprecated. Use link() instead.
*/
public function entangle(Box $b) : Box
{
return $this->link($b);
}

/**
* Assign some data to this Box.
*/
Expand Down

0 comments on commit a66448c

Please sign in to comment.