| Conditions | 4 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 4.0072 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 6 | public function push(string $name, mixed $payload = [], OptionsInterface $options = null): string |
|
| 28 | { |
||
| 29 | 6 | if ($options !== null && $options->getDelay()) { |
|
|
|
|||
| 30 | \sleep($options->getDelay()); |
||
| 31 | } |
||
| 32 | |||
| 33 | 6 | $id = (string)Uuid::uuid4(); |
|
| 34 | |||
| 35 | 6 | $this->coreHandler->handle( |
|
| 36 | 6 | name: $name, |
|
| 37 | 6 | driver: 'sync', |
|
| 38 | 6 | queue: 'default', |
|
| 39 | 6 | id: $id, |
|
| 40 | 6 | payload: $payload, |
|
| 41 | 6 | headers: $options instanceof ExtendedOptionsInterface ? $options->getHeaders() : [], |
|
| 42 | 6 | ); |
|
| 43 | |||
| 44 | 6 | return $id; |
|
| 45 | } |
||
| 47 |
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: