| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 1 | public function buildPathBetween($start, $end) : bool |
|
| 30 | { |
||
| 31 | 1 | $this->builder->rebuildRelationMap(); |
|
| 32 | |||
| 33 | 1 | $shortestPath = $this->dijkstra->shortestPaths($start, $end); |
|
| 34 | 1 | $prevRelations = $this->map[$start]['relations']; |
|
| 35 | |||
| 36 | 1 | $this->path = '_embedded'; |
|
| 37 | |||
| 38 | 1 | foreach ($shortestPath[0] as $meta) { |
|
| 39 | 1 | if ($relationName = array_search($meta, $prevRelations)) { |
|
| 40 | 1 | $this->path .= '.' . $relationName; |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | $prevRelations = $this->map[$meta]['relations']; |
|
| 44 | } |
||
| 45 | |||
| 46 | 1 | return true; |
|
| 47 | } |
||
| 67 |