4
4
5
5
use Fhaculty \Graph \Algorithm \BaseVertex ;
6
6
use Fhaculty \Graph \Walk ;
7
-
8
- use Fhaculty \Graph \Exception \UnderflowException ;
9
-
7
+ use Fhaculty \Graph \Exception \OutOfBoundsException ;
10
8
use Fhaculty \Graph \Exception \InvalidArgumentException ;
11
-
12
9
use Fhaculty \Graph \Vertex ;
13
10
use Fhaculty \Graph \Edge \Base as Edge ;
14
11
@@ -19,7 +16,7 @@ abstract class Base extends BaseVertex
19
16
*
20
17
* @param Vertex $endVertex
21
18
* @return Walk
22
- * @throws Exception when there's no walk from start to end vertex
19
+ * @throws OutOfBoundsException if there's no path to the given end vertex
23
20
* @uses self::getEdgesTo()
24
21
* @uses Walk::factoryFromEdges()
25
22
*/
@@ -32,7 +29,7 @@ public function getWalkTo(Vertex $endVertex)
32
29
* get array of edges (path) from start vertex to given end vertex
33
30
*
34
31
* @param Vertex $endVertex
35
- * @throws Exception
32
+ * @throws OutOfBoundsException if there's no path to the given end vertex
36
33
* @return Edge[]
37
34
* @uses AlgorithmSp::getEdges()
38
35
* @uses AlgorithmSp::getEdgesToInternal()
@@ -47,7 +44,7 @@ public function getEdgesTo(Vertex $endVertex)
47
44
*
48
45
* @param Vertex $endVertex
49
46
* @param array $edges array of all input edges to operate on
50
- * @throws Exception
47
+ * @throws OutOfBoundsException if there's no path to the given vertex
51
48
* @return Edge[]
52
49
* @uses AlgorithmSp::getEdges() if no edges were given
53
50
*/
@@ -69,7 +66,7 @@ protected function getEdgesToInternal(Vertex $endVertex, array $edges)
69
66
} // ignore: this edge does not point TO current vertex
70
67
}
71
68
if ($ pre === NULL ) {
72
- throw new UnderflowException ('No edge leading to vertex ' );
69
+ throw new OutOfBoundsException ('No edge leading to vertex ' );
73
70
}
74
71
}
75
72
@@ -138,7 +135,7 @@ public function getDistanceMap()
138
135
foreach ($ this ->vertex ->getGraph ()->getVertices () as $ vid => $ vertex ) {
139
136
try {
140
137
$ ret [$ vid ] = $ this ->sumEdges ($ this ->getEdgesToInternal ($ vertex , $ edges ));
141
- } catch (UnderflowException $ ignore ) {
138
+ } catch (OutOfBoundsException $ ignore ) {
142
139
} // ignore vertices that can not be reached
143
140
}
144
141
@@ -150,7 +147,7 @@ public function getDistanceMap()
150
147
*
151
148
* @param Vertex $endVertex
152
149
* @return float
153
- * @throws Exception if given vertex is invalid or there's no path to given end vertex
150
+ * @throws OutOfBoundsException if there's no path to the given end vertex
154
151
* @uses AlgorithmSp::getEdgesTo()
155
152
* @uses AlgorithmSp::sumEdges()
156
153
*/
0 commit comments