| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 54 | private static function hasValidParameterOrder(string $path): bool |
||
| 55 | { |
||
| 56 | $parts = explode('/', $path); |
||
| 57 | $optionalParamFound = false; |
||
| 58 | |||
| 59 | foreach ($parts as $part) { |
||
| 60 | if (preg_match(RouteParams::OPTIONAL_PARAM_PATTERN, $part)) { // Optional argument found |
||
| 61 | $optionalParamFound = true; |
||
| 62 | } elseif ($optionalParamFound) { // Mandatory argument or static part found after an optional argument |
||
| 63 | return false; |
||
| 64 | } |
||
| 65 | } |
||
| 66 | |||
| 67 | return true; |
||
| 68 | } |
||
| 70 |