| @@ 12-21 (lines=10) @@ | ||
| 9 | * |
|
| 10 | * @return string |
|
| 11 | */ |
|
| 12 | public static function dashesToCamelCase($string, $capitalizeFirstChar = false) |
|
| 13 | { |
|
| 14 | $str = str_replace(' ', '', ucwords(str_replace('-', ' ', $string))); |
|
| 15 | ||
| 16 | if (!$capitalizeFirstChar) { |
|
| 17 | $str = lcfirst($str); |
|
| 18 | } |
|
| 19 | ||
| 20 | return $str; |
|
| 21 | } |
|
| 22 | ||
| 23 | /** |
|
| 24 | * @param string $string |
|
| @@ 29-38 (lines=10) @@ | ||
| 26 | * |
|
| 27 | * @return string |
|
| 28 | */ |
|
| 29 | public static function underscoreToCamelCase($string, $capitalizeFirstChar = false) |
|
| 30 | { |
|
| 31 | $str = str_replace(' ', '', ucwords(str_replace('_', ' ', $string))); |
|
| 32 | ||
| 33 | if (!$capitalizeFirstChar) { |
|
| 34 | $str = lcfirst($str); |
|
| 35 | } |
|
| 36 | ||
| 37 | return $str; |
|
| 38 | } |
|
| 39 | ||
| 40 | /** |
|
| 41 | * @param int $length |
|