| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 44 | 16 | public function getIdentifierQuoter(\PDO $dbh): callable |
|
| 45 | { |
||
| 46 | 16 | if ($this->isMySQL($dbh)) { |
|
| 47 | // mysql mode |
||
| 48 | 8 | return function ($identifier) { |
|
| 49 | 8 | return '`' . str_replace('`', '``', $identifier) . '`'; |
|
| 50 | 8 | }; |
|
| 51 | } |
||
| 52 | |||
| 53 | // standard sql mode |
||
| 54 | 8 | return function ($identifier) { |
|
| 55 | 8 | return '"' . str_replace('"', '""', $identifier) . '"'; |
|
| 56 | 8 | }; |
|
| 57 | } |
||
| 58 | } |
||
| 59 |