| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 67 | public function genDsn($config): string |
||
| 68 | { |
||
| 69 | // Parse config |
||
| 70 | $dsn = ''; |
||
| 71 | foreach ($config as $key => $value) { |
||
| 72 | if (\in_array($key, self::AVAILABLE_OPTIONS, false)) { |
||
| 73 | $dsn .= "$key=$value;"; |
||
| 74 | } |
||
| 75 | } |
||
| 76 | |||
| 77 | // Get driver of connection |
||
| 78 | $driver = strtolower($config['driver']); |
||
| 79 | |||
| 80 | return "$driver:$dsn"; |
||
| 81 | } |
||
| 83 |