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