1 | <?php |
||
25 | trait EventBehaviour |
||
26 | { |
||
27 | use ImmutabilityBehaviour, ScalarPayloadBehaviour { |
||
28 | ScalarPayloadBehaviour::__call insteadof ImmutabilityBehaviour; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Event metadata. |
||
33 | * |
||
34 | * @var array<string, mixed> |
||
35 | */ |
||
36 | private $metadata = []; |
||
37 | |||
38 | /** |
||
39 | * @var \DateTimeImmutable |
||
40 | */ |
||
41 | private $createdAt; |
||
42 | |||
43 | /** |
||
44 | * Get event metadata. |
||
45 | * |
||
46 | * @return array<string, mixed> |
||
|
|||
47 | */ |
||
48 | final public function getMetadata(): array |
||
52 | |||
53 | /** |
||
54 | * Get event with new metadata. |
||
55 | * |
||
56 | * @param array<string, mixed> $metadata |
||
57 | * |
||
58 | * @return mixed|self |
||
59 | */ |
||
60 | final public function withMetadata(array $metadata) |
||
68 | |||
69 | /** |
||
70 | * Set event metadata. |
||
71 | * |
||
72 | * @param array<string, mixed> $parameters |
||
73 | * |
||
74 | * @throws InvalidScalarParameterException |
||
75 | */ |
||
76 | private function setMetadata(array $parameters): void |
||
98 | |||
99 | /** |
||
100 | * Get event creation time. |
||
101 | * |
||
102 | * @return \DateTimeImmutable |
||
103 | */ |
||
104 | final public function getCreatedAt(): \DateTimeImmutable |
||
108 | } |
||
109 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.