| Total Complexity | 15 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | final class PathValidator |
||
| 10 | { |
||
| 11 | 109 | public static function isValid(string $path): bool |
|
| 22 | 1 | } |
|
| 23 | |||
| 24 | private static function hasValidFormat(string $path): bool |
||
| 25 | 107 | { |
|
| 26 | 1 | if ($path === '') { |
|
| 27 | return false; |
||
| 28 | } |
||
| 29 | 106 | ||
| 30 | 106 | if (str_starts_with($path, '/')) { |
|
| 31 | return false; |
||
| 32 | 106 | } |
|
| 33 | 106 | ||
| 34 | 1 | if (str_ends_with($path, '/')) { |
|
| 35 | 106 | return false; |
|
| 36 | 10 | } |
|
| 37 | 106 | ||
| 38 | 2 | return !self::hasEmptyParts($path); |
|
| 39 | } |
||
| 40 | |||
| 41 | private static function hasEmptyParts(string $path): bool |
||
| 52 | } |
||
| 53 | |||
| 54 | private static function hasValidParameterOrder(string $path): bool |
||
| 73 |