| Conditions | 3 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 3.4746 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | 2 | protected function createPdoInstance(): \PDO |
|
| 29 | { |
||
| 30 | 2 | $instance = new \PDO($this->dsn, $this->username, $this->password, $this->options); |
|
| 31 | |||
| 32 | 2 | if ($this->emulatePrepare !== null) { |
|
| 33 | $instance->setAttribute(\PDO::ATTR_EMULATE_PREPARES, $this->emulatePrepare); |
||
| 34 | } |
||
| 35 | |||
| 36 | 2 | if ($this->charset) { |
|
| 37 | $pdo = $this->getPdo(); |
||
| 38 | $pdo->exec('SET NAMES ' . $pdo->quote($this->charset)); |
||
| 39 | } |
||
| 40 | |||
| 41 | 2 | return $instance; |
|
| 42 | } |
||
| 49 | } |