Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
29 | 6 | public static function create(array $data): self |
|
30 | { |
||
31 | 6 | $model = new self(); |
|
32 | 6 | $model->name = $data['name'] ?? null; |
|
33 | 6 | $model->smtpLogin = $data['smtp_login'] ?? null; |
|
34 | 6 | $model->smtpPassword = $data['smtp_password'] ?? null; |
|
35 | 6 | $model->wildcard = $data['wildcard'] ?? null; |
|
36 | 6 | $model->spamAction = $data['spam_action'] ?? null; |
|
37 | 6 | $model->state = $data['state'] ?? null; |
|
38 | 6 | $model->createdAt = isset($data['created_at']) ? new \DateTimeImmutable($data['created_at']) : null; |
|
39 | |||
40 | 6 | return $model; |
|
41 | } |
||
42 | |||
82 |