Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
37 | public function textToPascalCase ( string $word ) : string |
||
38 | { |
||
39 | // Make an array of word parts exploding the word by "_" |
||
40 | $wordParts = explode( "_", $word ); |
||
41 | |||
42 | // Make every word part lower case |
||
43 | $wordParts = array_map( "strtolower", $wordParts ); |
||
44 | |||
45 | // Make every word part first character uppercase |
||
46 | $wordParts = array_map( "ucfirst", $wordParts ); |
||
47 | |||
48 | // Make the new word the combination of the given word parts |
||
49 | return implode( "", $wordParts ); |
||
50 | } |
||
52 |