1 | <?php |
||
10 | final class SomethingHappened implements Event |
||
11 | { |
||
12 | /** |
||
13 | * @var AggregateRootId |
||
14 | */ |
||
15 | private $aggregateRootId; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $what; |
||
21 | |||
22 | /** |
||
23 | * @var bool |
||
24 | */ |
||
25 | private $yolo; |
||
26 | |||
27 | /** |
||
28 | * @var PointInTime |
||
29 | */ |
||
30 | private $timeOfRecording; |
||
31 | |||
32 | public function __construct( |
||
43 | |||
44 | public function aggregateRootId(): AggregateRootId |
||
48 | |||
49 | public function what(): string |
||
53 | |||
54 | public function yolo(): bool |
||
58 | |||
59 | public function eventVersion(): int |
||
63 | |||
64 | public function timeOfRecording(): PointInTime |
||
68 | |||
69 | public static function fromPayload( |
||
81 | |||
82 | public function toPayload(): array |
||
89 | |||
90 | /** |
||
91 | * @codeCoverageIgnore |
||
92 | */ |
||
93 | public function withWhat(string $what): SomethingHappened |
||
99 | |||
100 | /** |
||
101 | * @codeCoverageIgnore |
||
102 | */ |
||
103 | public function withYolo(bool $yolo): SomethingHappened |
||
109 | |||
110 | public static function with(AggregateRootId $aggregateRootId, PointInTime $timeOfRecording): SomethingHappened |
||
119 | |||
120 | } |
||
121 |