Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public static function init($gateway, $config=[]) |
||
29 | { |
||
30 | $gateway = StringTool::uFirst($gateway); |
||
31 | $class = __NAMESPACE__ . '\\Provider\\' . $gateway; |
||
32 | if (class_exists($class)) { |
||
33 | if(empty(self::$config)) self::config($config); |
||
34 | $objcet = new $class(self::$config); |
||
35 | return $objcet; |
||
36 | } else { |
||
37 | throw new Exception("err:{$class}类不存在"); |
||
38 | } |
||
66 |