Conditions | 4 |
Paths | 5 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
37 | public function buildConnection(): Connection |
||
38 | { |
||
39 | try { |
||
40 | if (!isset($this->pdo) || !($this->pdo instanceof \PDO)) { |
||
41 | $this->pdo = new \PDO($this->dsn, null, null, $this->pdo_options); |
||
42 | } |
||
43 | |||
44 | return new Connection($this->pdo); |
||
45 | } catch (\PDOException $e) { |
||
46 | throw new Exception($e->getMessage(), $e->getCode(), $e->errorInfo); |
||
47 | } |
||
50 |