| Total Complexity | 8 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | class DB |
||
| 6 | { |
||
| 7 | private static $db = null; |
||
| 8 | private static $driver; |
||
| 9 | |||
| 10 | public static function __callStatic(string $func, array $params) |
||
| 11 | { |
||
| 12 | return call_user_func_array([self::singleton(), $func], $params); |
||
| 13 | } |
||
| 14 | |||
| 15 | public static function config(array $config) |
||
| 16 | { |
||
| 17 | switch ($config['driver']) { |
||
| 18 | case 'mysql': |
||
| 19 | self::mysql($config); |
||
| 20 | break; |
||
| 21 | } |
||
| 22 | } |
||
| 23 | |||
| 24 | public static function conn(): void |
||
| 27 | } |
||
| 28 | |||
| 29 | public static function singleton(): Database |
||
| 36 | } |
||
| 37 | |||
| 38 | private static function mysql(array $config): void |
||
| 49 |