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