| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 49 | private function getConnection() |
||
| 50 | { |
||
| 51 | if (null === $this->connection) { |
||
| 52 | try { |
||
| 53 | $this->connection = new \PDO($this->config->getDsn(), $this->config->getUsername(), $this->config->getPassword(), |
||
| 54 | array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION)); |
||
| 55 | } catch (\PDOException $exception) { |
||
| 56 | throw new \InvalidArgumentException($exception->getMessage()); |
||
| 57 | } |
||
| 58 | } |
||
| 59 | |||
| 60 | return $this->connection; |
||
| 61 | } |
||
| 62 | } |
||
| 63 |