| Total Complexity | 5 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class Routing |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @param callable(RoutingConfigurator):void $fn |
||
| 11 | */ |
||
| 12 | 73 | public static function configure(callable $fn): void |
|
| 13 | { |
||
| 14 | 73 | $routingConfigurator = new RoutingConfigurator(); |
|
| 15 | 73 | $fn($routingConfigurator); |
|
| 16 | |||
| 17 | 72 | $route = self::findRoute($routingConfigurator); |
|
| 18 | |||
| 19 | 72 | if ($route) { |
|
| 20 | 65 | echo $route->run($routingConfigurator); |
|
| 21 | } |
||
| 22 | } |
||
| 23 | |||
| 24 | 72 | private static function findRoute(RoutingConfigurator $routingConfigurator): ?Route |
|
| 33 | } |
||
| 34 | } |
||
| 35 |