| Conditions | 4 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4.0072 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 23 | #[\Override] |
|
| 23 | public function createMember(EntityWithInteractionCheckInterface $entity): InteractionMemberInterface |
||
| 24 | { |
||
| 25 | 23 | if ($entity instanceof Colony) { |
|
| 26 | 4 | return new ColonyMember($this->tholianWebUtil, $entity); |
|
| 27 | } |
||
| 28 | 23 | if ($entity instanceof Spacecraft) { |
|
| 29 | 23 | return new SpacecraftMember( |
|
| 30 | 23 | $this->nbsUtility, |
|
| 31 | 23 | $this->tholianWebUtil, |
|
| 32 | 23 | $this->commodityTransfer, |
|
| 33 | 23 | $entity |
|
| 34 | 23 | ); |
|
| 35 | } |
||
| 36 | 1 | if ($entity instanceof Trumfield) { |
|
| 37 | 1 | return new TrumfieldMember($entity); |
|
| 38 | } |
||
| 39 | |||
| 40 | throw new RuntimeException('unknown entity class'); |
||
| 41 | } |
||
| 43 |