| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | 6 | private function getSubject(SpacecraftWrapperInterface $leadWrapper): SpacecraftWrapperInterface|FleetWrapperInterface |
|
| 27 | { |
||
| 28 | 6 | $fleetWrapper = $leadWrapper->getFleetWrapper(); |
|
| 29 | 6 | if ($fleetWrapper === null) { |
|
| 30 | return $leadWrapper; |
||
| 31 | } |
||
| 32 | |||
| 33 | 6 | $fleetLeader = $fleetWrapper->getLeadWrapper()->get(); |
|
| 34 | |||
| 35 | //TODO check for isFleetLeader too? |
||
| 36 | 6 | return $fleetLeader === $leadWrapper->get() |
|
|
|
|||
| 37 | 6 | ? $fleetWrapper |
|
| 38 | 6 | : $leadWrapper; |
|
| 39 | } |
||
| 49 |