| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | 2 | public function buildFromJson(string $jsonData): PurchaseHistory |
|
| 20 | { |
||
| 21 | 2 | $data = json_decode($jsonData, true); |
|
| 22 | |||
| 23 | 2 | return new PurchaseHistory( |
|
| 24 | 2 | $data['firstPurchaseHash'], |
|
| 25 | 2 | $data['lastPurchaseHash'], |
|
| 26 | 2 | $this->purchaseBuilder->buildFromArray($data['purchases']) |
|
| 27 | ); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |