Passed
Push — master ( a2be21...16cab6 )
by Benjamin
04:31 queued 02:34
created

KeepAliveRetryTransportWrapper   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 14
ccs 2
cts 2
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
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 4
    public function __construct(HttpTransport $transport)
18
    {
19
        parent::__construct($transport, 1, function (RuntimeException $e) {
20 3
            return $e->getMessage() === self::NO_RESPONSE;
21 4
        });
22 4
    }
23
}
24