| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | private static function getQuoteIdentifier(string $dsn): string |
||
| 36 | { |
||
| 37 | $adapter = explode(':', $dsn, 2)[0]; |
||
| 38 | $identifierMap = [ |
||
| 39 | 'mysql' => '`', |
||
| 40 | 'pgsql' => '"', |
||
| 41 | 'sqlite' => '"', |
||
| 42 | ]; |
||
| 43 | $quoteIdentifier = $identifierMap[$adapter] ?? null; |
||
| 44 | |||
| 45 | if ($quoteIdentifier === null) { |
||
| 46 | throw new PdoException("Unsupported adapter '$adapter' to detect quote identifier"); |
||
| 47 | } |
||
| 48 | |||
| 49 | return $quoteIdentifier; |
||
| 50 | } |
||
| 51 | } |
||
| 52 |