@@ -12,10 +12,10 @@ discard block |
||
12 | 12 | $cache = new ApcuCache(); |
13 | 13 | |
14 | 14 | $commands = [ |
15 | - '/pets/{id}:get' => function (int $id) use ($cache): Pet { |
|
15 | + '/pets/{id}:get' => function(int $id) use ($cache): Pet { |
|
16 | 16 | return unserialize($cache->fetch($id)); |
17 | 17 | }, |
18 | - '/pets:post' => function (Pet $pet) use ($cache) { |
|
18 | + '/pets:post' => function(Pet $pet) use ($cache) { |
|
19 | 19 | $count = $cache->fetch('count'); |
20 | 20 | $pet->setId($id = $count + 1); |
21 | 21 | $cache->save($id, serialize($pet)); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $request = ServerRequestFactory::fromGlobals($_SERVER, $_GET, $_POST, $_COOKIE, $_FILES); |
38 | 38 | |
39 | -$response = $pipe->dispatch($request, function () { |
|
39 | +$response = $pipe->dispatch($request, function() { |
|
40 | 40 | return Factory::createResponse(500); |
41 | 41 | }); |
42 | 42 |