Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
12 | 12 | public static function stripCamelCasePrefix($subject, $prefix) |
|
13 | { |
||
14 | 12 | if ($prefix === $subject) { |
|
15 | 1 | return ''; |
|
16 | } |
||
17 | 11 | if (strpos($subject, $prefix) !== 0) { |
|
18 | 10 | return false; |
|
19 | } |
||
20 | 10 | $cut = substr($subject, strlen($prefix)); |
|
21 | 10 | return strtolower($cut[0]) . substr($cut, 1); |
|
22 | } |
||
24 |