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