| Conditions | 5 |
| Paths | 11 |
| Total Lines | 20 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 1 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 22 | function execute() |
||
|
|
|||
| 23 | { |
||
| 24 | try { |
||
| 25 | while (1) { |
||
| 26 | $job = $this->queue->dequeue(); |
||
| 27 | if (!isset($job)) { |
||
| 28 | return; |
||
| 29 | } |
||
| 30 | $payload = $job->read(); |
||
| 31 | $this->output->writeln(" Flush, " . print_r($payload, true)); |
||
| 32 | $job->delete(); |
||
| 33 | } |
||
| 34 | } catch (\Exception $e) { |
||
| 35 | $this->logger->alert($e); |
||
| 36 | throw $e; |
||
| 37 | } catch (\Throwable $e) { |
||
| 38 | $this->logger->alert($e); |
||
| 39 | throw $e; |
||
| 40 | } |
||
| 41 | } |
||
| 42 | } |
||
| 43 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.