Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | 3 | protected function triggerSpecific( |
|
27 | ShipWrapperInterface $wrapper, |
||
28 | FlightRouteInterface $flightRoute, |
||
29 | MessageCollectionInterface $messages |
||
30 | ): void { |
||
31 | |||
32 | 3 | $ship = $wrapper->get(); |
|
33 | |||
34 | //leaving star system |
||
35 | 3 | if ($flightRoute->getRouteMode() === RouteModeEnum::ROUTE_MODE_SYSTEM_EXIT) { |
|
36 | 2 | $oldWaypoint = $ship->getCurrentMapField(); |
|
37 | 2 | if (!$oldWaypoint instanceof StarSystemMapInterface) { |
|
38 | 1 | throw new RuntimeException('this should not happen'); |
|
39 | } |
||
40 | |||
41 | 1 | $this->updateFlightDirection->updateWhenSystemExit($ship, $oldWaypoint); |
|
42 | } |
||
45 |