for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Tomaj\Hermes;
use Ramsey\Uuid\Uuid;
class Message implements MessageInterface
{
/**
* @var string
*/
private $type;
* @var array
private $payload;
private $messageId;
private $created;
private $executeAt;
* Native implementation of message.
*
* @var string $type
* @var array $payload
* @var string $messageId
* @var float $created timestamp (microtime(true))
* @var float $executeAt timestamp (microtime(true))
public function __construct(string $type, array $payload = null, string $messageId = null, float $created = null, float $executeAt = null)
$this->messageId = $messageId;
if (!$messageId) {
$this->messageId = Uuid::uuid4()->toString();
}
$this->created = $created;
$created
string
double
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.
$answer = 42; $correct = false; $correct = (bool) $answer;
if (!$created) {
$this->created = microtime(true);
microtime(true)
$this->type = $type;
$this->payload = $payload;
$this->executeAt = $executeAt;
$executeAt
* {@inheritdoc}
public function getId(): string
return $this->messageId;
public function getCreated(): float
return $this->created;
public function getExecuteAt(): ?float
return $this->executeAt;
public function getType(): string
return $this->type;
public function getPayload(): ?array
return $this->payload;
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.