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