| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 3 | public function execute($command, callable $next) |
|
| 34 | { |
||
| 35 | 3 | if ($command instanceof QueueableCommand) { |
|
| 36 | 1 | $queue = $this->getQueue(get_class($command)); |
|
| 37 | |||
| 38 | 1 | return $this->queue->add( |
|
| 39 | 1 | $queue, |
|
| 40 | // Wraps the command so it isn't requeued |
||
| 41 | 1 | new QueuedCommand($command) |
|
|
|
|||
| 42 | 1 | ); |
|
| 43 | } |
||
| 44 | |||
| 45 | 2 | if ($command instanceof QueuedCommand) { |
|
| 46 | 1 | $command = $command->command(); |
|
| 47 | 1 | } |
|
| 48 | |||
| 49 | 2 | return $next($command); |
|
| 50 | } |
||
| 51 | |||
| 74 |
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: