| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 61 | 1 | private function camelCaseToDash(string $key): string |
|
| 62 | { |
||
| 63 | 1 | $newKey = ''; |
|
| 64 | |||
| 65 | 1 | foreach (str_split($key) as $index => $letter) { |
|
| 66 | 1 | if (ctype_upper($letter)) { |
|
| 67 | 1 | $letter = strtolower($letter); |
|
| 68 | 1 | $letter = $index < 1 ? $letter : '-' . $letter; |
|
| 69 | } |
||
| 70 | 1 | $newKey .= $letter; |
|
| 71 | } |
||
| 72 | |||
| 73 | 1 | return $newKey; |
|
| 74 | } |
||
| 75 | } |