| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 40 | public function push(string $jobType, array $payload = [], Options $options = null): string |
||
| 41 | { |
||
| 42 | $payloadBody = $this->serialize($jobType, $payload); |
||
| 43 | if ($options !== null && $options->getDelay()) { |
||
|
|
|||
| 44 | sleep($options->getDelay()); |
||
| 45 | } |
||
| 46 | |||
| 47 | $id = (string)(++$this->id); |
||
| 48 | |||
| 49 | $this->registry->getHandler($jobType)->handle($jobType, $id, $payloadBody); |
||
| 50 | |||
| 51 | return $id; |
||
| 52 | } |
||
| 64 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
integervalues, zero is a special case, in particular the following results might be unexpected: