Conditions | 1 |
Paths | 1 |
Total Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public static function toPascalCase(string $source, string $separator = '_'): string |
||
22 | { |
||
23 | // If the string is snake case |
||
24 | $modified = str_replace($separator, ' ', $source); |
||
25 | $lowercase = mb_strtolower($modified); |
||
26 | $uppercaseFirstLetters = mb_convert_case($lowercase, MB_CASE_TITLE); |
||
27 | |||
28 | return str_replace(' ', '', $uppercaseFirstLetters); |
||
29 | } |
||
30 | |||
51 |