| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public function execute($command, callable $next) |
||
| 33 | { |
||
| 34 | if ($command instanceof QueueableCommand) { |
||
| 35 | $queue = $this->getQueue(get_class($command)); |
||
| 36 | |||
| 37 | return $this->queue->add( |
||
| 38 | $queue, |
||
| 39 | // Wraps the command so it isn't requeued |
||
| 40 | new QueuedCommand($command) |
||
|
|
|||
| 41 | ); |
||
| 42 | } |
||
| 43 | |||
| 44 | if ($command instanceof QueuedCommand) { |
||
| 45 | $command = $command->command(); |
||
| 46 | } |
||
| 47 | |||
| 48 | return $next($command); |
||
| 49 | } |
||
| 50 | |||
| 73 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: