| Conditions | 4 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | 3 | public function initMembers(): Collection |
|
| 18 | { |
||
| 19 | 3 | $fleet = $this->leader->getFleetWrapper(); |
|
| 20 | 3 | if ($fleet === null) { |
|
| 21 | |||
| 22 | // if flying ship is cloaked, nothing happens |
||
| 23 | 2 | if ($this->leader->get()->getCloakState()) { |
|
| 24 | 1 | return new ArrayCollection(); |
|
| 25 | } |
||
| 26 | |||
| 27 | 1 | return $this->createSingleton($this->leader); |
|
| 28 | } |
||
| 29 | |||
| 30 | // filter warped and cloaked |
||
| 31 | 1 | return $fleet->getShipWrappers() |
|
| 32 | 1 | ->filter(fn (ShipWrapperInterface $wrapper) => !$wrapper->get()->getCloakState() |
|
| 33 | 1 | && !$wrapper->get()->isWarped()); |
|
| 34 | } |
||
| 36 |