Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
35 | protected function getFlightRoute(ShipWrapperInterface $wrapper): FlightRouteInterface |
||
36 | { |
||
37 | $ship = $wrapper->get(); |
||
38 | |||
39 | $starsystemMap = $ship->getStarsystemMap(); |
||
40 | if ($starsystemMap === null) { |
||
41 | throw new RuntimeException('should not happen'); |
||
42 | } |
||
43 | |||
44 | //the destination map field |
||
45 | $destination = $starsystemMap->getSystem()->getMapField(); |
||
46 | if ($destination === null) { |
||
47 | throw new RuntimeException('should not happen'); |
||
48 | } |
||
49 | |||
50 | return $this->flightRouteFactory->getRouteForMapDestination($destination); |
||
51 | } |
||
53 |