1 | <?php |
||
7 | class Graph |
||
8 | { |
||
9 | /** |
||
10 | * @var AdjacencyList |
||
11 | */ |
||
12 | private $graph; |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private $visited = []; |
||
18 | |||
19 | /** |
||
20 | * Graph constructor. |
||
21 | * |
||
22 | * @param AdjacencyList $graph |
||
23 | */ |
||
24 | public function __construct(AdjacencyList $graph) |
||
28 | |||
29 | /** |
||
30 | * @param Version $from |
||
31 | * @param Version $to |
||
32 | * |
||
33 | * @return array |
||
34 | */ |
||
35 | public function getPath(Version $from, Version $to) |
||
48 | |||
49 | /** |
||
50 | * @param $path |
||
51 | * |
||
52 | * @return array |
||
53 | */ |
||
54 | private function getRealHops($path) |
||
73 | |||
74 | /** |
||
75 | * Finds least number of hops (edges) between 2 nodes (vertices) |
||
76 | * "breadth first" search |
||
77 | * |
||
78 | * @param Version $from |
||
79 | * @param Version $to |
||
80 | * |
||
81 | * @return array |
||
82 | */ |
||
83 | private function breadthFirstSearch(Version $from, Version $to) |
||
133 | |||
134 | /** |
||
135 | * @param Version $from |
||
136 | * |
||
137 | * @return OrderedList |
||
|
|||
138 | */ |
||
139 | private function getOriginVertexes(Version $from) |
||
151 | |||
152 | /** |
||
153 | * @param Version $to |
||
154 | * |
||
155 | * @return OrderedList |
||
156 | */ |
||
157 | private function getDestinationVertexes(Version $to) |
||
163 | } |
||
164 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.