KeepAliveRetryTransportWrapper::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 2

Importance

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