Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
81 | 3 | public static function createFromArray(array $data) |
|
82 | { |
||
83 | 3 | $item = new self(); |
|
84 | 3 | $item->count = $data['count'] ?? null; |
|
85 | 3 | $item->discount = $data['discount'] ?? null; |
|
86 | 3 | $item->itemNo = $data['item_no'] ?? null; |
|
87 | 3 | $item->title = $data['title'] ?? null; |
|
88 | 3 | $item->description = $data['description'] ?? null; |
|
89 | 3 | $item->price = $data['price'] ?? null; |
|
90 | 3 | $item->vat = $data['vat'] ?? null; |
|
91 | 3 | $item->unit = $data['unit'] ?? null; |
|
92 | 3 | $item = $item->withBookkeeping(Bookkeeping::createFromArray($data['bookkeeping'])) ?? null; |
|
93 | |||
94 | 3 | return $item; |
|
95 | } |
||
96 | } |
||
97 |