| Total Complexity | 3 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 13 | class UserDenormalizer implements DenormalizerInterface |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @inheritdoc |
||
| 17 | */ |
||
| 18 | public function denormalize($data, $class, $format = null, array $context = array()): User |
||
| 19 | { |
||
| 20 | return new User( |
||
| 21 | Uuid::fromString($data['id']), |
||
| 22 | new Email($data['email']), |
||
| 23 | Password::fromHash($data['password']), |
||
| 24 | new NotEmptyString($data['lastName']), |
||
| 25 | new NotEmptyString($data['firstName']), |
||
| 26 | new Role($data['role']) |
||
| 27 | ); |
||
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @inheritdoc |
||
| 32 | */ |
||
| 33 | public function supportsDenormalization($data, $type, $format = null): bool |
||
| 36 | } |
||
| 37 | } |
||
| 38 |