Conditions | 7 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 7 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
59 | 3 | public function send(Message $message) |
|
60 | { |
||
61 | 3 | $tries = 0; |
|
62 | |||
63 | 3 | while (true) { |
|
64 | try { |
||
65 | 3 | $tries++; |
|
66 | 3 | return $this->transport->send($message); |
|
67 | 3 | } catch (\Exception $e) { |
|
68 | 3 | if ($this->maxRetries !== 0 && $tries > $this->maxRetries) { |
|
69 | 2 | throw $e; |
|
70 | } |
||
71 | |||
72 | 3 | if ($this->exceptionMatcher && !call_user_func($this->exceptionMatcher, $e)) { |
|
73 | 1 | throw $e; |
|
74 | } |
||
79 |