1 | <?php |
||
15 | class ServiceFactory |
||
|
|||
16 | { |
||
17 | /** |
||
18 | * List of usable exchange rate services. |
||
19 | * @var string(s) |
||
20 | */ |
||
21 | const FIXER = 'fixer'; |
||
22 | const YAHOO = 'yahoo'; |
||
23 | |||
24 | /** |
||
25 | * A list of all usable exchange rate services. |
||
26 | * @var array |
||
27 | */ |
||
28 | private static $SERVICES = [ |
||
29 | self::FIXER, |
||
30 | self::YAHOO |
||
31 | ]; |
||
32 | |||
33 | /** |
||
34 | * Constructor |
||
35 | * |
||
36 | * This class cannot be instantiated. |
||
37 | */ |
||
38 | private function __construct() {} |
||
39 | |||
40 | /** |
||
41 | * Create and return a \Swap\Swap object based on the provided |
||
42 | * service name. |
||
43 | * |
||
44 | * @param string $service The name of the service to use. |
||
45 | * |
||
46 | * @return \Swap\Swap |
||
47 | */ |
||
48 | 3 | public static function getService($service) |
|
71 | } |