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