Test Failed
Pull Request — master (#128)
by
unknown
06:53
created

KeepAliveRetryTransportWrapper::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Gelf\Transport;
4
5
use RuntimeException;
6
7
class KeepAliveRetryTransportWrapper extends RetryTransportWrapper
8
{
9
    /**
10
     * @const string
11
     */
12
    const NO_RESPONSE = "Graylog-Server didn't answer properly, expected 'HTTP/1.x 202 Accepted', response is ''";
13
14
    /**
15
     * @param HttpTransport $transport
16
     */
17
    public function __construct(HttpTransport $transport)
18
    {
19
        parent::__construct($transport, 1, function (RuntimeException $e) {
20
            return $e->getMessage() === self::NO_RESPONSE;
21
        });
22
    }
23
}
24