| Conditions | 5 | 
| Paths | 8 | 
| Total Lines | 19 | 
| Code Lines | 9 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 9 | 
| CRAP Score | 5.025 | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 17 | 288 | public function createConnection(): PDO  | 
            |
| 18 |     { | 
            ||
| 19 | 288 | $this->attributes += [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION];  | 
            |
| 20 | |||
| 21 | 288 |         if (PHP_VERSION_ID >= 80100) { | 
            |
| 22 | $this->attributes += [PDO::ATTR_STRINGIFY_FETCHES => true];  | 
            ||
| 23 | }  | 
            ||
| 24 | |||
| 25 | 288 | $pdo = parent::createConnection();  | 
            |
| 26 | |||
| 27 | 288 |         if ($this->charset !== null) { | 
            |
| 28 | 1 |             $pdo->exec('SET NAMES ' . $pdo->quote($this->charset)); | 
            |
| 29 | }  | 
            ||
| 30 | |||
| 31 | 288 |         if ($this->charset === null && !str_contains($this->dsn, 'charset')) { | 
            |
| 32 | 2 |             $pdo->exec('SET NAMES ' . $pdo->quote('utf8mb4')); | 
            |
| 33 | }  | 
            ||
| 34 | |||
| 35 | 288 | return $pdo;  | 
            |
| 36 | }  | 
            ||
| 43 |