Skip to content

Commit 1424021

Browse files
committed
Improve documentation
1 parent 7458d1c commit 1424021

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/TrivialGraphFormat.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
use Fhaculty\Graph\Graph;
99

1010
/**
11+
* Trivial Graph Format (TGF) is a really simple format for describing graphs.
12+
*
13+
* It consists of a list of vertices, a separator and a list of directed edges
14+
* as vertex pairs. Each entry can only have a single plain text label assigned
15+
* which does not support any structured information.
1116
*
1217
* @author clue
1318
* @link http://en.wikipedia.org/wiki/Trivial_Graph_Format
@@ -52,6 +57,12 @@ public function getOutput(Graph $graph)
5257
return $output;
5358
}
5459

60+
/**
61+
* get label for given $vertex
62+
*
63+
* @param Vertex $vertex
64+
* @return string
65+
*/
5566
protected function getVertexLabel(Vertex $vertex)
5667
{
5768
// label defaults to the vertex ID
@@ -76,6 +87,12 @@ protected function getVertexLabel(Vertex $vertex)
7687
return $label;
7788
}
7889

90+
/**
91+
* get label for given $edge
92+
*
93+
* @param Edge $edge
94+
* @return string label (may be empty if there's nothing to be described)
95+
*/
7996
protected function getEdgeLabel(Edge $edge)
8097
{
8198
$label = '';

0 commit comments

Comments
 (0)