Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
27 | 5 | public function get(Destination $destination): Gateway |
|
28 | { |
||
29 | 5 | $destinationType = $destination->destinationType(); |
|
30 | 5 | if (!isset($this->gateways[$destinationType])) { |
|
31 | 1 | throw new InvalidArgumentException( |
|
32 | 1 | sprintf( |
|
33 | 1 | 'No gateway for destination type (%s) is supported.', |
|
34 | 1 | $destinationType |
|
35 | ) |
||
36 | ); |
||
37 | } |
||
38 | |||
39 | 4 | return $this->gateways[$destinationType]; |
|
40 | } |
||
41 | } |
||
42 |