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