Skip to content

Commit

Permalink
Fixed Message hints from Scrutinizier
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaj committed Oct 20, 2020
1 parent f4004c5 commit 71322ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Message implements MessageInterface
private $type;

/**
* @var array
* @var array|null
*/
private $payload;

Expand All @@ -28,7 +28,7 @@ class Message implements MessageInterface
private $created;

/**
* @var string
* @var float|null
*/
private $executeAt;

Expand All @@ -50,11 +50,11 @@ class Message implements MessageInterface
public function __construct(string $type, array $payload = null, string $messageId = null, float $created = null, float $executeAt = null, int $retries = 0)
{
$this->messageId = $messageId;
if (!$messageId) {
if ($messageId === null || $messageId == "") {
try {
$this->messageId = Uuid::uuid4()->toString();
} catch (\Exception $e) {
$this->messageId = rand(10000, 99999999);
$this->messageId = (string) rand(10000, 99999999);
}
}
$this->created = $created;
Expand Down

0 comments on commit 71322ac

Please sign in to comment.