Conditions | 1 |
Paths | 1 |
Total Lines | 29 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Tests | 18 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
23 | 32 | public function __invoke(ContainerInterface $container, string $serviceName, callable $callback) |
|
24 | { |
||
25 | /** @var $app Application */ |
||
26 | 32 | $app = $callback(); |
|
27 | |||
28 | 32 | $app->get('/config/{id:\d+}', [ |
|
29 | 32 | GetConfigAction::class |
|
30 | 32 | ], 'get_config'); |
|
31 | |||
32 | 32 | $app->get('/configs', [ |
|
33 | 32 | GetConfigsAction::class |
|
34 | 32 | ], 'get_configs'); |
|
35 | |||
36 | 32 | $app->post('/config', [ |
|
37 | 32 | BodyParamsMiddleware::class, |
|
38 | AddConfigAction::class |
||
39 | 32 | ], 'add_config'); |
|
40 | |||
41 | 32 | $app->put('/config/{id:\d+}', [ |
|
42 | 32 | BodyParamsMiddleware::class, |
|
43 | UpdateConfigAction::class |
||
44 | 32 | ], 'update_config'); |
|
45 | |||
46 | 32 | $app->delete('/config/{id:\d+}', [ |
|
47 | 32 | DeleteConfigAction::class |
|
48 | 32 | ], 'delete_config'); |
|
49 | |||
50 | 32 | return $app; |
|
51 | } |
||
52 | } |
||
53 |