Skip to content

Commit 0aa5ee5

Browse files
committed
Improve documentation
1 parent af6ce61 commit 0aa5ee5

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/Tree/Base.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* Tree\BaseDirected.
3030
*
3131
* @link http://en.wikipedia.org/wiki/Tree_%28graph_theory%29
32+
* @link http://en.wikipedia.org/wiki/Tree_%28data_structure%29
3233
* @see Undirected for an implementation of these algorithms on (undirected) trees
3334
* @see BaseDirected for an abstract implementation of these algorithms on directed, rooted trees
3435
*/

src/Tree/BaseDirected.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function getVertexRoot()
7272
* checks if this is a tree
7373
*
7474
* @return boolean
75-
* @uses Graph::isEmpty() to skip empty Graphs (an empty is Graph is a valid tree)
75+
* @uses Graph::isEmpty() to skip empty Graphs (an empty Graph is a valid tree)
7676
* @uses self::getVertexRoot() to get root Vertex to start search from
7777
* @uses self::getVerticesSubtree() to count number of vertices connected to root
7878
*/
@@ -130,7 +130,7 @@ public function getVertexParent(Vertex $vertex)
130130
*
131131
* @param Vertex $vertex
132132
* @return Vertex[]
133-
* @throws UnexpectedValueException if the given $vertex contains invalid / parallel links (check isTree()!)
133+
* @throws UnexpectedValueException if the given $vertex contains invalid / parallel edges (check isTree()!)
134134
*/
135135
abstract public function getVerticesChildren(Vertex $vertex);
136136

@@ -142,6 +142,7 @@ abstract public function getVerticesChildren(Vertex $vertex);
142142
*
143143
* @param Vertex $vertex
144144
* @return Vertex[]
145+
* @throws UnexpectedValueException if the given $vertex contains invalid / parallel edges (check isTree()!)
145146
*/
146147
abstract protected function getVerticesParent(Vertex $vertex);
147148

src/Tree/Undirected.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function isVertexInternal(Vertex $vertex)
102102
* @param Vertex[] $vertices
103103
* @param Vertex|null $ignore
104104
* @throws UnexpectedValueException for cycles or directed edges (check isTree()!)
105-
* @uses self::getVerticesNeighboor()
105+
* @uses self::getVerticesNeighbor()
106106
* @uses self::getVerticesSubtreeRecursive() to recurse into sub-subtrees
107107
*/
108108
private function getVerticesSubtreeRecursive(Vertex $vertex, &$vertices, Vertex $ignore = null)
@@ -113,7 +113,7 @@ private function getVerticesSubtreeRecursive(Vertex $vertex, &$vertices, Vertex
113113
}
114114
$vertices[$vertex->getId()] = $vertex;
115115

116-
foreach ($this->getVerticesNeighboor($vertex) as $vertexNeighboor) {
116+
foreach ($this->getVerticesNeighbor($vertex) as $vertexNeighboor) {
117117
if ($vertexNeighboor === $ignore) {
118118
// ignore source vertex only once
119119
$ignore = null;
@@ -124,7 +124,7 @@ private function getVerticesSubtreeRecursive(Vertex $vertex, &$vertices, Vertex
124124
}
125125

126126
/**
127-
* get neighboor vertices for given start vertex
127+
* get neighbor vertices for given start vertex
128128
*
129129
* @param Vertex $vertex
130130
* @throws UnexpectedValueException for directed edges
@@ -133,7 +133,7 @@ private function getVerticesSubtreeRecursive(Vertex $vertex, &$vertices, Vertex
133133
* @uses Edge::getVertexToFrom()
134134
* @see Vertex::getVerticesEdge()
135135
*/
136-
private function getVerticesNeighboor(Vertex $vertex)
136+
private function getVerticesNeighbor(Vertex $vertex)
137137
{
138138
$vertices = array();
139139
foreach ($vertex->getEdges() as $edge) {

0 commit comments

Comments
 (0)