| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 36 | public function findConsignmentService(ManufacturerInterface $manufacturer): ConsignmentServiceInterface |
||
| 37 | { |
||
| 38 | $name = Container::camelize($manufacturer->getName()).'ConsignmentService'; |
||
| 39 | |||
| 40 | if (!isset($this->consignmentServices[$name])) { |
||
| 41 | throw new NonExistentConsignmentServiceException('Consignment service `'.$name.'` not found. Did you mean any of these? '.join(', ', array_keys($this->consignmentServices))); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** @var ConsignmentServiceInterface $service */ |
||
| 45 | $service = $this->consignmentServices[$name]; |
||
| 46 | $service->setManufacturer($manufacturer); |
||
| 47 | |||
| 48 | return $service; |
||
| 49 | } |
||
| 50 | } |
||
| 51 |