| 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 |
||
| 28 | 50 | protected function fromCamelCase($input, $glue = '_') |
|
| 29 | { |
||
| 30 | 50 | preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches); |
|
| 31 | 50 | $ret = $matches[0]; |
|
| 32 | 50 | foreach ($ret as &$match) { |
|
| 33 | 50 | $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match); |
|
| 34 | } |
||
| 35 | 50 | return implode($glue, $ret); |
|
| 36 | } |
||
| 50 |