Conditions | 3 |
Paths | 4 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
44 | 51 | public function __construct(string $type, array $payload = null, string $messageId = null, float $created = null, float $executeAt = null) |
|
45 | 51 | { |
|
46 | 51 | $this->messageId = $messageId; |
|
47 | 34 | if (!$messageId) { |
|
48 | 51 | $this->messageId = Uuid::uuid4()->toString(); |
|
49 | 51 | } |
|
50 | 51 | $this->created = $created; |
|
|
|||
51 | if (!$created) { |
||
52 | $this->created = microtime(true); |
||
53 | } |
||
54 | $this->type = $type; |
||
55 | 42 | $this->payload = $payload; |
|
56 | $this->executeAt = $executeAt; |
||
57 | 42 | } |
|
58 | |||
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.