Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
9 | public static function strip($value) |
||
10 | { |
||
11 | $originalValue = $value = trim($value, '/'); |
||
12 | |||
13 | $segments = static::all(); |
||
14 | |||
15 | foreach ($segments as $segment) { |
||
16 | if (0 === strpos($originalValue, $segment)) { |
||
17 | $value = substr($value, strlen($segment)); |
||
18 | } |
||
19 | } |
||
20 | |||
21 | return trim($value, '/'); |
||
22 | } |
||
39 |