| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function getDataProvider(int $id, ShipcountLayerTypeEnum $type): AbstractPanelLayerDataProvider |
||
| 27 | { |
||
| 28 | switch ($type) { |
||
| 29 | case ShipcountLayerTypeEnum::ALL: |
||
| 30 | return new GeneralShipcountDataProvider($this->mapRepository, $this->starSystemMapRepository); |
||
| 31 | case ShipcountLayerTypeEnum::ALLIANCE_ONLY: |
||
| 32 | return new AllianceShipcountDataProvider($id, $this->mapRepository, $this->starSystemMapRepository); |
||
| 33 | case ShipcountLayerTypeEnum::USER_ONLY: |
||
| 34 | return new UserShipcountDataProvider($id, $this->mapRepository, $this->starSystemMapRepository); |
||
| 35 | } |
||
| 36 | |||
| 37 | throw new RuntimeException(sprintf('Shipcount layer type %d is not supported', $type->value)); |
||
| 38 | } |
||
| 40 |