| Total Complexity | 2 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class Strings |
||
| 8 | { |
||
| 9 | public static function snakeToCamel(string $input): string |
||
| 10 | { |
||
| 11 | $callback = function ($match) { |
||
| 12 | return mb_strtoupper(mb_substr($match[0], mb_strlen($match[0]) - 1)); |
||
| 13 | }; |
||
| 14 | return preg_replace_callback('~_+\w~u', $callback, trim($input, '_')); |
||
| 15 | } |
||
| 16 | |||
| 17 | public static function camelToSnake(string $input): string |
||
| 23 | } |
||
| 24 | } |
||
| 25 |