| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | 2 | public function consume($queue) |
|
| 34 | { |
||
| 35 | 2 | $value = $this->client->lpop($queue); |
|
| 36 | 2 | if ($value === null) { |
|
| 37 | 1 | return; |
|
| 38 | } |
||
| 39 | |||
| 40 | 1 | $decoded = json_decode($value, true); |
|
| 41 | 1 | $command = call_user_func($this->resolver, $decoded['command']); |
|
| 42 | |||
| 43 | $command |
||
| 44 | 1 | ->withOptions($decoded['options']) |
|
| 45 | 1 | ->execute(); |
|
| 46 | 1 | } |
|
| 47 | } |
||
| 48 |