Conditions | 3 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
62 | public static function getConverterGraph(): Graph |
||
63 | { |
||
64 | $graph = new Graph(); |
||
65 | |||
66 | /** @var Vertex[] $vertices */ |
||
67 | $vertices = []; |
||
68 | |||
69 | foreach (self::getColors() as $color) { |
||
70 | $vertices[$color] = $graph->createVertex($color); |
||
71 | } |
||
72 | |||
73 | foreach (self::getConverters() as $converter) { |
||
74 | $vertices[$converter::supportsFrom()]->createEdgeTo($vertices[$converter::supportsTo()])->setAttribute(self::GRAPH_EDGE_KEY_CONVERTER, $converter); |
||
75 | } |
||
76 | |||
77 | return $graph; |
||
78 | } |
||
80 |