Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
28 | public function genDsn($config): string |
||
29 | { |
||
30 | // Parse config |
||
31 | $dsn = ''; |
||
32 | foreach ($config as $key => $value) { |
||
33 | if (\in_array($key, self::AVAILABLE_OPTIONS, false)) { |
||
34 | $dsn .= $value; |
||
35 | } |
||
36 | } |
||
37 | |||
38 | // Get driver of connection |
||
39 | $driver = strtolower($config['driver']); |
||
40 | |||
41 | return "$driver:$dsn"; |
||
42 | } |
||
45 |