| Conditions | 7 | 
| Paths | 9 | 
| Total Lines | 26 | 
| Code Lines | 16 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 14 | 
| CRAP Score | 7 | 
| Changes | 0 | ||
| 1 | <?php | ||
| 42 | 5 | public function process(): int | |
| 43 |     { | ||
| 44 | 5 | $count = 0; | |
| 45 | 5 |         foreach ($this->queue as $queue) { | |
| 46 |             try { | ||
| 47 | 5 |                 while ($message = $queue->fetch()) { | |
| 48 | 5 |                     if ($this->limit > 0 && $this->limit <= $count) { | |
| 49 | 1 | $queue->store($message); | |
| 50 | |||
| 51 | 1 | return $count; | |
| 52 | } | ||
| 53 |                     try { | ||
| 54 | 5 | $this->transport->send($message); | |
| 55 | 2 |                     } catch (AbstractProtocolException $e) { | |
| 56 | 2 | $queue->store($message); | |
| 57 | |||
| 58 | 2 | return $count; | |
| 59 | } | ||
| 60 | 3 | ++$count; | |
| 61 | } | ||
| 62 | 2 |             } catch (EmptyQueueException $e) { | |
|  | |||
| 63 | } | ||
| 64 | } | ||
| 65 | |||
| 66 | 2 | return $count; | |
| 67 | } | ||
| 68 | } | ||
| 69 |