Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
2 / 2 |
| ToCamelCaseStrategy | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
| transform | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| <?php | |
| namespace Siesta\NamingStrategy; | |
| class ToCamelCaseStrategy implements NamingStrategy | |
| { | |
| /** | |
| * @param string $value | |
| * | |
| * @return string | |
| */ | |
| public function transform(string $value) : string | |
| { | |
| $func = create_function('$c', 'return strtoupper($c[1]);'); | |
| return preg_replace_callback('/_([a-z])/', $func, $value); | |
| } | |
| } |