Total Complexity | 6 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Coverage | 42.86% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
7 | class GatewayFactory |
||
8 | { |
||
9 | public const GATEWAY_NAMESPACE = 'Larium\\Pay\\Gateway\\'; |
||
10 | |||
11 | private static $gateways = []; |
||
12 | |||
13 | private function __construct() |
||
14 | { |
||
15 | } |
||
16 | |||
17 | /** |
||
18 | * Register a gateway with given name and class name. |
||
19 | * |
||
20 | * @throws Larium\Pay\GatewayException |
||
21 | * |
||
22 | * @param string $name The unique name for the gateway. |
||
23 | * @param string $className The full class name of gateway. |
||
24 | * @return void |
||
25 | */ |
||
26 | public static function register($name, $className) |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * Return an instance of a Gateway based on given name. |
||
36 | * |
||
37 | * @param string $name The registered name of Gateway |
||
38 | * @param array $options Options for gateway |
||
39 | * @return \Larium\Pay\Gateway\Gateway |
||
40 | */ |
||
41 | 2 | public static function create($name, array $options = []) |
|
58 |