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