| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 2 | protected function createUserEntity(array $data) : UserEntity |
|
| 42 | { |
||
| 43 | /** @var UserEntity $entity */ |
||
| 44 | 2 | $entity = $this->getNewEntityInstance(UserEntity::class); |
|
| 45 | |||
| 46 | 2 | $entity->setUserId((int) $data['id_user']) |
|
| 47 | 2 | ->setUserName($data['username']) |
|
| 48 | 2 | ->setEmail($data['email']) |
|
| 49 | 2 | ->setPassword($data['password']) |
|
| 50 | 2 | ->setHash($data['hash']) |
|
| 51 | 2 | ->setActive((bool) $data['is_active']) |
|
| 52 | 2 | ->setEnabled((bool) $data['is_enabled']) |
|
| 53 | 2 | ->setDateCreated(new DateTime($data['date_created'] ?? 'now')) |
|
| 54 | 2 | ->setDateModified(new DateTime($data['date_modified'] ?? 'now')); |
|
| 55 | |||
| 56 | 2 | return $entity; |
|
| 57 | } |
||
| 58 | } |
||
| 59 |