Conditions | 1 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | protected function textToCamelCase ( string $word ) : string |
||
35 | { |
||
36 | // Make an array of word parts exploding the word by "_" |
||
37 | $wordParts = explode( "_", $word ); |
||
38 | |||
39 | // Make every word part lower case |
||
40 | $wordParts = array_map( "strtolower", $wordParts ); |
||
41 | |||
42 | // Make ever word part first character uppercase |
||
43 | $wordParts = array_map( "ucfirst", $wordParts ); |
||
44 | |||
45 | // Make the new word as the combination of the given word parts |
||
46 | $newWord = implode( "", $wordParts ); |
||
47 | |||
48 | // Make the new word first character lowercase |
||
49 | $newWord = lcfirst( $newWord ); |
||
50 | |||
51 | return $newWord; |
||
52 | } |
||
54 |