Conditions | 3 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
48 | 3 | public static function getService($service) |
|
49 | { |
||
50 | switch ($service) { |
||
51 | |||
52 | // Fixer |
||
53 | 3 | case self::FIXER: |
|
54 | 1 | return (new \Swap\Builder()) |
|
55 | 1 | ->add('fixer') |
|
56 | 1 | ->build(); |
|
57 | |||
58 | // Yahoo |
||
59 | 2 | case self::YAHOO: |
|
60 | 1 | return (new \Swap\Builder()) |
|
61 | 1 | ->add('yahoo') |
|
62 | 1 | ->build(); |
|
63 | |||
64 | default: |
||
65 | 1 | throw new UnsupportedExchangeServiceProvidedException( |
|
66 | 1 | "'$service' is not supported in MoneyMan." . |
|
67 | 1 | "Please use one of the following: " . implode(", ", self::$SERVICES) |
|
68 | ); |
||
69 | } |
||
70 | } |
||
71 | } |