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

KeepAliveRetryTransportWrapper::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

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
ccs 2
cts 2
cp 1
crap 1
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 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