1 | <?php |
||
8 | class Message implements MessageInterface |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | private $type; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | private $payload; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $messageId; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $created; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $executeAt; |
||
34 | |||
35 | /** |
||
36 | * Native implementation of message. |
||
37 | * |
||
38 | 51 | * @var string $type |
|
39 | * @var array $payload |
||
40 | 51 | * @var string $messageId |
|
41 | 51 | * @var float $created timestamp (microtime(true)) |
|
42 | 51 | * @var float $executeAt timestamp (microtime(true)) |
|
43 | 34 | */ |
|
44 | 51 | public function __construct(string $type, array $payload = null, string $messageId = null, float $created = null, float $executeAt = null) |
|
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function getId(): string |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function getCreated(): float |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function getExecuteAt(): ?float |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | */ |
||
86 | public function getType(): string |
||
90 | |||
91 | /** |
||
92 | * {@inheritdoc} |
||
93 | */ |
||
94 | public function getPayload(): ?array |
||
98 | } |
||
99 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.