| Total Complexity | 6 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class BaseUrlSegment |
||
| 8 | { |
||
| 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 | } |
||
| 23 | |||
| 24 | private static function all(): array |
||
| 37 | } |
||
| 38 | } |
||
| 39 |