| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 60 | private function getQueue($command_name) |
||
| 61 | { |
||
| 62 | // TODO: refactor this? |
||
| 63 | foreach ($this->queue_map as $queue => $commands) { |
||
| 64 | if (in_array($command_name, $commands)) { |
||
| 65 | return $queue; |
||
| 66 | } |
||
| 67 | } |
||
| 68 | |||
| 69 | // TODO: throw exception or just a generic queue? |
||
| 70 | throw new \Exception('no queue belongs to that command'); |
||
| 71 | } |
||
| 72 | } |
||
| 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: