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