Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
49 | public static function camelize($input, $separator = '-', $lcFirst = false) |
||
50 | { |
||
51 | assert(is_string($input)); |
||
52 | $spaced = str_replace($separator, ' ', $input); |
||
53 | $result = str_replace(' ', '', ucwords($spaced)); |
||
54 | if ($lcFirst) |
||
55 | { |
||
56 | return lcfirst($result); |
||
57 | } |
||
58 | return $result; |
||
59 | } |
||
60 | } |