| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public static function createFromArray(array $data): self |
||
| 27 | { |
||
| 28 | $itemReasons = []; |
||
| 29 | foreach ($data['item_reasons'] as $itemReason) { |
||
| 30 | $itemReasons[] = ThresholdItemReason::createFromArray($itemReason); |
||
| 31 | } |
||
| 32 | |||
| 33 | $model = new self(); |
||
| 34 | $model->amountGte = (int) $data['amount_gte']; |
||
| 35 | $model->itemReasons = $itemReasons; |
||
| 36 | |||
| 37 | return $model; |
||
| 38 | } |
||
| 39 | |||
| 50 |