Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
26 | 3 | public static function create(array $data): self |
|
27 | { |
||
28 | 3 | $model = new self(); |
|
29 | 3 | $model->id = $data['id'] ?? null; |
|
30 | 3 | $model->priority = $data['priority'] ?? null; |
|
31 | 3 | $model->filter = $data['expression'] ?? null; |
|
32 | 3 | $model->actions = Action::createMultiple($data['actions'] ?? []); |
|
33 | 3 | $model->description = $data['description'] ?? null; |
|
34 | 3 | $model->createdAt = isset($data['created_at']) ? new \DateTimeImmutable($data['created_at']) : null; |
|
35 | |||
36 | 3 | return $model; |
|
37 | } |
||
38 | |||
76 |