| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 6 | private function configurePDOSQLite($params, &$pdoDsn, &$pdoUsername, &$pdoPassword) |
||
| 7 | { |
||
| 8 | $defaultParams = [ |
||
| 9 | 'username' => null, |
||
| 10 | 'password' => null, |
||
| 11 | 'memory' => null, |
||
| 12 | 'file' => null, |
||
| 13 | ]; |
||
| 14 | |||
| 15 | $params = array_merge($defaultParams, $params); |
||
| 16 | |||
| 17 | $pdoDsn = 'sqlite'; |
||
| 18 | |||
| 19 | if ($params['memory']) { |
||
| 20 | $pdoDsn .= '::memory:'; |
||
| 21 | } else { |
||
| 22 | $pdoDsn .= ':' . $params['file']; |
||
| 23 | } |
||
| 24 | |||
| 25 | $pdoUsername = $params['username']; |
||
| 26 | $pdoPassword = $params['password']; |
||
| 27 | } |
||
| 28 | } |