Total Complexity | 9 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class RetryTransportWrapper extends AbstractTransport |
||
9 | { |
||
10 | /** |
||
11 | * @const string |
||
12 | */ |
||
13 | const NO_RESPONSE = "Graylog-Server didn't answer properly, expected 'HTTP/1.x 202 Accepted', response is ''"; |
||
14 | |||
15 | /** |
||
16 | * @var TransportInterface |
||
17 | */ |
||
18 | protected $transport; |
||
19 | |||
20 | /** |
||
21 | * @var int |
||
22 | */ |
||
23 | protected $maxRetries; |
||
24 | |||
25 | /** |
||
26 | * @var callable|null |
||
27 | */ |
||
28 | protected $exceptionMatcher; |
||
29 | |||
30 | /** |
||
31 | * KeepAliveRetryTransportWrapper constructor. |
||
32 | * |
||
33 | * @param TransportInterface $transport |
||
34 | * @param int $maxRetries |
||
35 | * @param callable|null $exceptionMatcher |
||
36 | */ |
||
37 | 4 | public function __construct(TransportInterface $transport, $maxRetries, $exceptionMatcher = null) |
|
42 | 4 | } |
|
43 | |||
44 | /** |
||
45 | * @return TransportInterface |
||
46 | */ |
||
47 | 1 | public function getTransport() |
|
48 | { |
||
49 | 1 | return $this->transport; |
|
50 | } |
||
51 | |||
52 | /** |
||
53 | * Sends a Message over this transport. |
||
54 | * |
||
55 | * @param Message $message |
||
56 | * |
||
57 | * @return int calls function to send message |
||
58 | */ |
||
59 | 3 | public function send(Message $message) |
|
74 | } |
||
75 | } |
||
79 |