Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
25 | 3 | public static function create(array $data): self |
|
26 | { |
||
27 | 3 | $model = new self(); |
|
28 | 3 | $model->name = $data['name'] ?? null; |
|
29 | 3 | $model->address = $data['address'] ?? null; |
|
30 | 3 | $model->accessLevel = $data['access_level'] ?? null; |
|
31 | 3 | $model->description = $data['description'] ?? null; |
|
32 | 3 | $model->membersCount = (int) ($data['members_count'] ?? 0); |
|
33 | 3 | $model->createdAt = isset($data['created_at']) ? new \DateTimeImmutable($data['created_at']) : null; |
|
34 | |||
35 | 3 | return $model; |
|
36 | } |
||
37 | |||
72 |