| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 90% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | final class PDODriver extends AbstractPDODriver |
||
| 11 | { |
||
| 12 | 198 | public function createConnection(): PDO |
|
| 13 | { |
||
| 14 | 198 | $this->attributes += [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]; |
|
| 15 | 198 | if (PHP_VERSION_ID >= 80100) { |
|
| 16 | $this->attributes += [PDO::ATTR_STRINGIFY_FETCHES => true]; |
||
| 17 | } |
||
| 18 | |||
| 19 | 198 | $pdo = parent::createConnection(); |
|
| 20 | |||
| 21 | 198 | if ($this->charset !== null) { |
|
| 22 | 198 | $pdo->exec('SET NAMES ' . $pdo->quote($this->charset)); |
|
| 23 | } |
||
| 24 | |||
| 25 | 198 | return $pdo; |
|
| 26 | } |
||
| 27 | |||
| 28 | 10 | public function getDriverName(): string |
|
| 31 | } |
||
| 32 | } |
||
| 33 |