Conditions | 3 |
Paths | 3 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 40 | protected function fromCamelCase($input, $glue = '_') |
|
30 | { |
||
31 | 40 | preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches); |
|
32 | 40 | $ret = $matches[0]; |
|
33 | 40 | foreach ($ret as &$match) { |
|
34 | 40 | $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match); |
|
35 | } |
||
36 | 40 | return implode($glue, $ret); |
|
37 | } |
||
50 | } |