| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | 225 | protected function convertIdInString(string $data): string |
|
| 30 | { |
||
| 31 | 225 | $replace = [ |
|
| 32 | 225 | "/^id$/" => '_key', |
|
| 33 | 225 | "/\.id$/" => '._key' |
|
| 34 | 225 | ]; |
|
| 35 | //TODO: we probably only want to replace .id if the prefix is a table or table alias. |
||
| 36 | |||
| 37 | 225 | return (string) preg_replace( |
|
| 38 | 225 | array_keys($replace), |
|
| 39 | 225 | $replace, |
|
| 40 | 225 | $data, |
|
| 41 | 225 | 1 |
|
| 42 | 225 | ); |
|
| 66 |