| Conditions | 3 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 7 | ||
| Bugs | 1 | Features | 4 |
| 1 | <?php |
||
| 53 | 3 | protected function tick($queue) |
|
| 54 | { |
||
| 55 | 3 | $message = $this->driver->dequeue($queue); |
|
| 56 | 3 | if (empty($message)) { |
|
| 57 | 1 | return true; |
|
| 58 | } |
||
| 59 | |||
| 60 | 2 | $command = unserialize($message); |
|
| 61 | try { |
||
| 62 | 2 | $this->event->acknowledge($command); |
|
| 63 | 2 | $this->command_bus->handle($command); |
|
| 64 | 1 | $this->event->finish($command); |
|
| 65 | 2 | } catch (Exception $exception) { |
|
| 66 | 1 | $this->event->reject($command, $exception); |
|
| 67 | } |
||
| 68 | |||
| 69 | 2 | return true; |
|
| 70 | } |
||
| 71 | } |
||
| 72 |