HttpDriver::readResponse()   A
last analyzed

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 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Dazzle\Http\Http\Driver;
4
5
use Dazzle\Http\Http\Driver\Reader\HttpReader;
6
use Dazzle\Http\Http\Driver\Reader\HttpReaderInterface;
7
use Dazzle\Util\Buffer\BufferInterface;
8
9
class HttpDriver implements HttpDriverInterface
10
{
11
    /**
12
     * @var mixed[]
13
     */
14
    protected $options;
15
16
    /**
17
     * @var HttpReaderInterface
18
     */
19
    protected $reader;
20
21
    /**
22
     * @param mixed[] $options
23
     */
24 69
    public function __construct($options = [])
25
    {
26 69
        $this->options = $options;
27 69
        $this->reader = new HttpReader($this->options);
28 69
    }
29
30
    /**
31
     *
32
     */
33 30
    public function __destruct()
34
    {
35 30
        unset($this->options);
36 30
        unset($this->reader);
37 30
    }
38
39
    /**
40
     * @override
41
     * @inheritDoc
42
     */
43 4
    public function readRequest(BufferInterface $buffer, $message)
44
    {
45 4
        return $this->reader->readRequest($buffer, $message);
46
    }
47
48
    /**
49
     * @override
50
     * @inheritDoc
51
     */
52 1
    public function readResponse(BufferInterface $buffer, $message)
53
    {
54 1
        return $this->reader->readResponse($buffer, $message);
55
    }
56
}
57