| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 35 | public static function getDestination() |
||
| 36 | { |
||
| 37 | $url = Url::format(Url::$path); |
||
| 38 | $matches = []; |
||
| 39 | |||
| 40 | foreach (static::$routes as $request => $destination) { |
||
| 41 | $pattern = '@^' . Url::format($request) . '$@'; |
||
| 42 | $match = preg_match($pattern, $url, $matches); |
||
| 43 | if ($match) { |
||
| 44 | return [...explode('@', $destination), ...array_splice($matches, 1)]; |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | throw new HttpException('Route not found', 404); |
||
| 49 | } |
||
| 51 |