Skip to content

Commit 42e511b

Browse files
committed
Rename leaf to node
1 parent fd3178a commit 42e511b

File tree

4 files changed

+155
-155
lines changed

4 files changed

+155
-155
lines changed

src/NestedSetInterface.php

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -10,108 +10,108 @@ interface NestedSetInterface {
1010
/**
1111
* Adds a child to the parent.
1212
*
13-
* @param \PNX\Tree\Leaf $parent
13+
* @param \PNX\Tree\Node $parent
1414
* The parent.
15-
* @param \PNX\Tree\Leaf $child
15+
* @param \PNX\Tree\Node $child
1616
* The child.
1717
*
18-
* @return \PNX\Tree\Leaf
19-
* Returns a new child leaf with left and right.
18+
* @return \PNX\Tree\Node
19+
* Returns a new child node with left and right.
2020
*/
21-
public function addLeaf(Leaf $parent, Leaf $child);
21+
public function addNode(Node $parent, Node $child);
2222

2323
/**
24-
* Deletes a leaf and moves descendants up a level.
24+
* Deletes a node and moves descendants up a level.
2525
*
26-
* @param \PNX\Tree\Leaf $leaf
27-
* The leaf to delete.
26+
* @param \PNX\Tree\Node $node
27+
* The node to delete.
2828
*/
29-
public function deleteLeaf(Leaf $leaf);
29+
public function deleteNode(Node $node);
3030

3131
/**
32-
* Deletes a leaf and all it's descendants.
32+
* Deletes a node and all it's descendants.
3333
*
34-
* @param \PNX\Tree\Leaf $leaf
35-
* The leaf to delete.
34+
* @param \PNX\Tree\Node $node
35+
* The node to delete.
3636
*/
37-
public function deleteSubTree(Leaf $leaf);
37+
public function deleteSubTree(Node $node);
3838

3939
/**
40-
* Finds all descendants of a leaf.
40+
* Finds all descendants of a node.
4141
*
42-
* @param \PNX\Tree\Leaf $leaf
43-
* The leaf.
42+
* @param \PNX\Tree\Node $node
43+
* The node.
4444
* @param int $depth
4545
* (optional) A depth limit. Defaults to 0, no limit.
4646
*
4747
* @return array
4848
* The nested array of descendants.
4949
*/
50-
public function findDescendants(Leaf $leaf, $depth = 0);
50+
public function findDescendants(Node $node, $depth = 0);
5151

5252
/**
53-
* Finds all ancestors of a leaf.
53+
* Finds all ancestors of a node.
5454
*
55-
* @param \PNX\Tree\Leaf $leaf
56-
* The leaf.
55+
* @param \PNX\Tree\Node $node
56+
* The node.
5757
*
5858
* @return array
5959
* The ancestors.
6060
*/
61-
public function findAncestors(Leaf $leaf);
61+
public function findAncestors(Node $node);
6262

6363
/**
64-
* Gets a leaf for the ID and Revision ID.
64+
* Gets a node for the ID and Revision ID.
6565
*
6666
* @param int|string $id
6767
* The ID.
6868
* @param int|string $revision_id
6969
* The revision ID.
7070
*
71-
* @return \PNX\Tree\Leaf
72-
* The leaf.
71+
* @return \PNX\Tree\Node
72+
* The node.
7373
*/
74-
public function getLeaf($id, $revision_id);
74+
public function getNode($id, $revision_id);
7575

7676
/**
77-
* Moves a Leaf and its sub-tree below the target leaf.
77+
* Moves a node and its sub-tree below the target node.
7878
*
79-
* @param Leaf $target
80-
* The leaf to move below.
81-
* @param \PNX\Tree\Leaf $leaf
82-
* The leaf to move.
79+
* @param Node $target
80+
* The node to move below.
81+
* @param \PNX\Tree\Node $node
82+
* The node to move.
8383
*/
84-
public function moveSubTreeBelow(Leaf $target, Leaf $leaf);
84+
public function moveSubTreeBelow(Node $target, Node $node);
8585

8686
/**
87-
* Moves a Leaf and its sub-tree before the target leaf.
87+
* Moves a node and its sub-tree before the target node.
8888
*
89-
* @param Leaf $target
90-
* The leaf to move before.
91-
* @param \PNX\Tree\Leaf $leaf
92-
* The leaf to move.
89+
* @param Node $target
90+
* The node to move before.
91+
* @param \PNX\Tree\Node $node
92+
* The node to move.
9393
*/
94-
public function moveSubTreeBefore(Leaf $target, Leaf $leaf);
94+
public function moveSubTreeBefore(Node $target, Node $node);
9595

9696
/**
97-
* Moves a Leaf and its sub-tree after the target leaf.
97+
* Moves a node and its sub-tree after the target node.
9898
*
99-
* @param Leaf $target
100-
* The leaf to move after.
101-
* @param \PNX\Tree\Leaf $leaf
102-
* The leaf to move.
99+
* @param Node $target
100+
* The node to move after.
101+
* @param \PNX\Tree\Node $node
102+
* The node to move.
103103
*/
104-
public function moveSubTreeAfter(Leaf $target, Leaf $leaf);
104+
public function moveSubTreeAfter(Node $target, Node $node);
105105

106106
/**
107-
* Gets a leaf at a specified left position.
107+
* Gets a node at a specified left position.
108108
*
109109
* @param int $left
110110
* The left position.
111111
*
112-
* @return Leaf
113-
* The leaf.
112+
* @return Node
113+
* The node.
114114
*/
115-
public function getLeafAtPosition($left);
115+
public function getNodeAtPosition($left);
116116

117117
}

src/Leaf.php renamed to src/Node.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
namespace PNX\Tree;
44

55
/**
6-
* Model object that represents a leaf in a tree.
6+
* Model object that represents a node in a tree.
77
*/
8-
class Leaf {
8+
class Node {
99

1010
/**
11-
* The Leaf ID.
11+
* The node ID.
1212
*
1313
* @var string|int
1414
*/
@@ -43,7 +43,7 @@ class Leaf {
4343
protected $depth;
4444

4545
/**
46-
* Leaf constructor.
46+
* node constructor.
4747
*
4848
* @param int|string $id
4949
* The ID.

0 commit comments

Comments
 (0)