| Conditions | 1 |
| Paths | 1 |
| Total Lines | 27 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 17 | public function register(Container $container) |
||
| 18 | { |
||
| 19 | $container['api-http.request.manager'] = function () use ($container) { |
||
| 20 | return new RequestManager( |
||
| 21 | $container['api-http.request.contentNegotiator'], |
||
| 22 | $container['deserializer'], |
||
| 23 | $container['deserializer.transformer'] |
||
| 24 | ); |
||
| 25 | }; |
||
| 26 | |||
| 27 | $container['api-http.request.contentNegotiator'] = function () { |
||
| 28 | return new ContentNegotiator(); |
||
| 29 | }; |
||
| 30 | |||
| 31 | $container['api-http.request.manager'] = function () use ($container) { |
||
| 32 | return new ResponseManager( |
||
| 33 | $container['api-http.request.manager'], |
||
| 34 | $container['api-http.response.factory'], |
||
| 35 | $container['serializer'], |
||
| 36 | $container['serializer.transformer'] |
||
| 37 | ); |
||
| 38 | }; |
||
| 39 | |||
| 40 | $container['api-http.response.factory'] = function () { |
||
| 41 | throw new \RuntimeException('Missing response factory, define service "api-http.response.factory"'); |
||
| 42 | }; |
||
| 43 | } |
||
| 44 | } |
||
| 45 |