| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | 2 | public static function createFromResponse(ResponseInterface $response): Library |
|
| 14 | { |
||
| 15 | 2 | $data = json_decode($response->getBody()->getContents(), true); |
|
| 16 | |||
| 17 | 2 | return new Library( |
|
| 18 | 2 | Uuid::fromString($data['fromEventLogUuid']), |
|
| 19 | 2 | Uuid::fromString($data['untilEventLogUuid']), |
|
| 20 | 2 | ProductParser::parseArray($data['products']), |
|
| 21 | 2 | DiscountParser::parseArray($data['discounts']), |
|
| 22 | 2 | ProductParser::parseArray($data['deletedProducts']), |
|
| 23 | 2 | DiscountParser::parseArray($data['deletedDiscounts']) |
|
| 24 | ); |
||
| 25 | } |
||
| 26 | } |
||
| 27 |