@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | $app->get('/version', 'App\Controller\DefaultController:getVersion'); |
| 5 | 5 | $app->get('/status', 'App\Controller\DefaultController:getStatus'); |
| 6 | 6 | |
| 7 | -$app->group('/api/v1', function () use ($app) { |
|
| 8 | - $app->group('/tasks', function () use ($app) { |
|
| 7 | +$app->group('/api/v1', function() use ($app) { |
|
| 8 | + $app->group('/tasks', function() use ($app) { |
|
| 9 | 9 | $app->get('', 'App\Controller\Task\GetAllTasks'); |
| 10 | 10 | $app->get('/[{id}]', 'App\Controller\Task\GetOneTask'); |
| 11 | 11 | $app->get('/search/[{query}]', 'App\Controller\Task\SearchTasks'); |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | $app->put('/[{id}]', 'App\Controller\Task\UpdateTask'); |
| 14 | 14 | $app->delete('/[{id}]', 'App\Controller\Task\DeleteTask'); |
| 15 | 15 | }); |
| 16 | - $app->group('/users', function () use ($app) { |
|
| 16 | + $app->group('/users', function() use ($app) { |
|
| 17 | 17 | $app->get('', 'App\Controller\User\GetAllUsers'); |
| 18 | 18 | $app->get('/[{id}]', 'App\Controller\User\GetOneUser'); |
| 19 | 19 | $app->get('/search/[{query}]', 'App\Controller\User\SearchUsers'); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | * @param ContainerInterface $c |
| 16 | 16 | * @return PDO |
| 17 | 17 | */ |
| 18 | -$container['db'] = function (ContainerInterface $c) { |
|
| 18 | +$container['db'] = function(ContainerInterface $c) { |
|
| 19 | 19 | $db = $c->get('settings')['db']; |
| 20 | 20 | $database = sprintf('mysql:host=%s;dbname=%s', $db['host'], $db['dbname']); |
| 21 | 21 | $pdo = new PDO($database, $db['user'], $db['pass']); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * @param ContainerInterface $c |
| 32 | 32 | * @return bool|Logger |
| 33 | 33 | */ |
| 34 | -$container['logger'] = function (ContainerInterface $c) { |
|
| 34 | +$container['logger'] = function(ContainerInterface $c) { |
|
| 35 | 35 | $settings = $c->get('settings')['logger']; |
| 36 | 36 | if ($settings['enabled'] === false) { |
| 37 | 37 | return false; |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * @param ContainerInterface $c |
| 51 | 51 | * @return UserService |
| 52 | 52 | */ |
| 53 | -$container['user_service'] = function ($container) { |
|
| 53 | +$container['user_service'] = function($container) { |
|
| 54 | 54 | return new UserService($container->get('user_repository')); |
| 55 | 55 | }; |
| 56 | 56 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | * @param ContainerInterface $c |
| 59 | 59 | * @return UserRepository |
| 60 | 60 | */ |
| 61 | -$container['user_repository'] = function ($container) { |
|
| 61 | +$container['user_repository'] = function($container) { |
|
| 62 | 62 | return new UserRepository($container->get('db')); |
| 63 | 63 | }; |
| 64 | 64 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * @param ContainerInterface $c |
| 67 | 67 | * @return TaskService |
| 68 | 68 | */ |
| 69 | -$container['task_service'] = function ($container) { |
|
| 69 | +$container['task_service'] = function($container) { |
|
| 70 | 70 | return new TaskService($container->get('task_repository')); |
| 71 | 71 | }; |
| 72 | 72 | |
@@ -74,6 +74,6 @@ discard block |
||
| 74 | 74 | * @param ContainerInterface $c |
| 75 | 75 | * @return TaskRepository |
| 76 | 76 | */ |
| 77 | -$container['task_repository'] = function ($container) { |
|
| 77 | +$container['task_repository'] = function($container) { |
|
| 78 | 78 | return new TaskRepository($container->get('db')); |
| 79 | 79 | }; |