Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
50.00% |
1 / 2 |
CRAP | |
50.00% |
1 / 2 |
| ToUnderScoreStrategy | |
0.00% |
0 / 1 |
|
50.00% |
1 / 2 |
2.50 | |
50.00% |
1 / 2 |
| transform | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
| getColumnName | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
|||
| <?php | |
| namespace Siesta\NamingStrategy; | |
| /** | |
| * @author Gregor Müller | |
| */ | |
| class ToUnderScoreStrategy implements NamingStrategy | |
| { | |
| /** | |
| * @param string $value | |
| * | |
| * @return string | |
| */ | |
| public function transform(string $value) : string | |
| { | |
| return ltrim(strtolower(preg_replace('/[A-Z]/', '_$0', $value)), '_'); | |
| } | |
| public function getColumnName() { | |
| } | |
| } |