Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.243 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 1 | protected function normalizeString($string) |
|
30 | { |
||
31 | 1 | if (false === strpos($string, '_')) { |
|
32 | 1 | return $string; |
|
33 | } |
||
34 | |||
35 | 1 | $offset = strspn($string, '_'); |
|
36 | 1 | if ($offset) { |
|
37 | $underscorePrefix = substr($string, 0, $offset); |
||
38 | $string = substr($string, $offset); |
||
39 | } else { |
||
40 | 1 | $underscorePrefix = ''; |
|
41 | } |
||
42 | |||
43 | 1 | return $underscorePrefix.parent::normalizeString($string); |
|
44 | } |
||
45 | } |
||
46 |