| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 51 | 8 | public function getIdentifierQuoter(\PDO $dbh): callable |
|
| 52 | { |
||
| 53 | 8 | if ($this->isMySQL($dbh)) { |
|
| 54 | // mysql mode |
||
| 55 | 4 | return function ($identifier) { |
|
| 56 | 4 | return '`' . str_replace('`', '``', $identifier) . '`'; |
|
| 57 | 4 | }; |
|
| 58 | } |
||
| 59 | |||
| 60 | // standard sql mode |
||
| 61 | 4 | return function ($identifier) { |
|
| 62 | 4 | return '"' . str_replace('"', '""', $identifier) . '"'; |
|
| 63 | 4 | }; |
|
| 64 | } |
||
| 65 | } |
||
| 66 |