| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 12 | public static function camelCaseToUnderscore($input) |
||
| 13 | { |
||
| 14 | $output = ''; |
||
| 15 | $outputParts = preg_split('/(?=[\p{Lu}])/', $input); |
||
| 16 | foreach ($outputParts as $outputPart) { |
||
| 17 | if ($outputPart) { |
||
| 18 | $output .= rtrim($outputPart, '_').'_'; |
||
| 19 | } |
||
| 20 | } |
||
| 21 | |||
| 22 | $output = mb_strtolower(rtrim($output, '_')); |
||
| 23 | |||
| 24 | return $output; |
||
| 25 | } |
||
| 26 | } |
||
| 27 |