| Conditions | 3 |
| Paths | 4 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 5.0538 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 33 | public function connect( |
|
| 28 | array $params, |
||
| 29 | string $username = '', |
||
| 30 | string $password = '', |
||
| 31 | array $driverOptions = [] |
||
| 32 | ) : Connection { |
||
| 33 | 33 | if (! empty($params['persistent'])) { |
|
| 34 | 1 | $driverOptions[PDO::ATTR_PERSISTENT] = true; |
|
| 35 | } |
||
| 36 | |||
| 37 | try { |
||
| 38 | 33 | return new PDOConnection( |
|
| 39 | 33 | $this->constructPdoDsn($params), |
|
| 40 | $username, |
||
| 41 | $password, |
||
| 42 | $driverOptions |
||
| 43 | ); |
||
| 44 | 3 | } catch (PDOException $e) { |
|
| 45 | 3 | throw DBALException::driverException($this, $e); |
|
| 46 | } |
||
| 67 |