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