@@ -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 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | $parameterNames[] = $parameterName; |
71 | 71 | $typePattern = $this->typePatternResolver->resolve($schema); |
72 | 72 | $parameterPattern = "(?P<$parameterName>$typePattern)(?=(/|$))"; |
73 | - $pathPattern = str_replace('{' . $parameterName . '}', $parameterPattern, $pathPattern); |
|
73 | + $pathPattern = str_replace('{'.$parameterName.'}', $parameterPattern, $pathPattern); |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 |