Conditions | 4 |
Paths | 3 |
Total Lines | 22 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | 4 | public function check( |
|
14 | ShipWrapperInterface $wrapper, |
||
15 | FlightRouteInterface $flightRoute, |
||
16 | ConditionCheckResult $conditionCheckResult |
||
17 | ): void { |
||
18 | |||
19 | 4 | $ship = $wrapper->get(); |
|
20 | |||
21 | 4 | if ($ship->isTractored()) { |
|
22 | 1 | $conditionCheckResult->addBlockedShip( |
|
23 | 1 | $ship, |
|
24 | 1 | sprintf(_('Die %s wird von einem Traktorstrahl gehalten'), $ship->getName()) |
|
25 | 1 | ); |
|
26 | |||
27 | 1 | return; |
|
28 | } |
||
29 | |||
30 | 3 | $holdingWeb = $ship->getHoldingWeb(); |
|
31 | 3 | if ($holdingWeb !== null && $holdingWeb->isFinished()) { |
|
32 | 1 | $conditionCheckResult->addBlockedShip( |
|
33 | 1 | $ship, |
|
34 | 1 | sprintf(_('Die %s wird von einem Energienetz gehalten'), $ship->getName()) |
|
35 | 1 | ); |
|
39 |