| 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 float |
||
| 27 | */ |
||
| 28 | private $created; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var string |
||
| 32 | */ |
||
| 33 | private $executeAt; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var int |
||
| 37 | */ |
||
| 38 | 51 | private $retries; |
|
| 39 | |||
| 40 | 51 | /** |
|
| 41 | 51 | * Native implementation of message. |
|
| 42 | 51 | * |
|
| 43 | 34 | * @var string $type |
|
| 44 | 51 | * @var array $payload |
|
| 45 | 51 | * @var string $messageId |
|
| 46 | 51 | * @var float $created timestamp (microtime(true)) |
|
| 47 | 34 | * @var float $executeAt timestamp (microtime(true)) |
|
| 48 | 51 | * @var int $retries |
|
| 49 | 51 | */ |
|
| 50 | 51 | public function __construct(string $type, array $payload = null, string $messageId = null, float $created = null, float $executeAt = null, int $retries = 0) |
|
| 70 | |||
| 71 | 48 | /** |
|
| 72 | * {@inheritdoc} |
||
| 73 | 48 | */ |
|
| 74 | public function getId(): string |
||
| 78 | |||
| 79 | 48 | /** |
|
| 80 | * {@inheritdoc} |
||
| 81 | 48 | */ |
|
| 82 | public function getCreated(): float |
||
| 86 | |||
| 87 | /** |
||
| 88 | * {@inheritdoc} |
||
| 89 | */ |
||
| 90 | public function getExecuteAt(): ?float |
||
| 94 | |||
| 95 | /** |
||
| 96 | * {@inheritdoc} |
||
| 97 | */ |
||
| 98 | public function getType(): string |
||
| 102 | |||
| 103 | /** |
||
| 104 | * {@inheritdoc} |
||
| 105 | */ |
||
| 106 | public function getPayload(): ?array |
||
| 110 | |||
| 111 | /** |
||
| 112 | * {@inheritdoc} |
||
| 113 | */ |
||
| 114 | public function getRetries(): int |
||
| 118 | } |
||
| 119 |
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.