Conditions | 3 |
Paths | 2 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.0987 |
Changes | 0 |
1 | <?php |
||
30 | 5 | public static function createFromArray(array $data): self |
|
31 | { |
||
32 | 5 | $customFields = []; |
|
33 | 5 | if (isset($data['custom_fields'])) { |
|
34 | foreach ($data['custom_fields'] as $customField) { |
||
35 | $customFields[] = new CustomField($customField['name'], $customField['value']); |
||
36 | } |
||
37 | } |
||
38 | |||
39 | 5 | $model = new self(); |
|
40 | 5 | $model->customFields = $customFields; |
|
41 | 5 | $model->footer = $data['footer']; |
|
42 | |||
43 | 5 | return $model; |
|
44 | } |
||
45 | |||
56 |