| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function denormalize($data, $class, $format = null, array $context = []) : UserSignedUp |
||
| 32 | { |
||
| 33 | $userSignedUp = new UserSignedUp( |
||
| 34 | UserId::generate($data['payload']['user_id']) |
||
| 35 | ); |
||
| 36 | |||
| 37 | $reflectionClass = new \ReflectionClass($userSignedUp); |
||
| 38 | $reflectionProperty = $reflectionClass->getProperty('occurredOn'); |
||
| 39 | $reflectionProperty->setAccessible(true); |
||
| 40 | $reflectionProperty->setValue( |
||
| 41 | $userSignedUp, |
||
| 42 | \DateTimeImmutable::createFromFormat('U', (string) $data['occurred_on']) |
||
| 43 | ); |
||
| 44 | |||
| 45 | return $userSignedUp; |
||
| 46 | } |
||
| 47 | |||
| 53 |