| Total Complexity | 3 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | final class ApiRouting |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * |
||
| 14 | * @return Dispatcher |
||
| 15 | */ |
||
| 16 | public static function create(): Dispatcher |
||
| 17 | { |
||
| 18 | return cachedDispatcher(function (RouteCollector $r) |
||
| 19 | { |
||
| 20 | $r->get( '/tasks', ListTasks::class ); |
||
| 21 | $r->post( '/tasks', AddTask::class ); |
||
| 22 | $r->get( '/task/{identifier}', ShowTask::class ); |
||
| 23 | |||
| 24 | }, [ |
||
| 25 | 'cacheFile' => self::getRoutingCachePath(), |
||
| 26 | 'cacheDisabled' => !Environment::isProd(), |
||
| 27 | ]); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * |
||
| 32 | * @return string |
||
| 33 | */ |
||
| 34 | private static function getRoutingCachePath(): string |
||
| 42 | } |
||
| 43 | } |
||
| 44 |