| Total Complexity | 4 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class DummyIncrementingHappened implements SerializablePayload |
||
| 14 | { |
||
| 15 | private int $number; |
||
| 16 | |||
| 17 | public function __construct(int $number) |
||
| 18 | { |
||
| 19 | $this->number = $number; |
||
| 20 | } |
||
| 21 | |||
| 22 | public function toPayload(): array |
||
| 23 | { |
||
| 24 | return ['number' => $this->number]; |
||
| 25 | } |
||
| 26 | |||
| 27 | public static function fromPayload(array $payload): self |
||
| 28 | { |
||
| 29 | return new DummyIncrementingHappened($payload['number']); |
||
| 30 | } |
||
| 31 | |||
| 32 | public function number(): int |
||
| 35 | } |
||
| 36 | } |
||
| 37 |