HttpDriver   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 48
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __destruct() 0 5 1
A readRequest() 0 4 1
A readResponse() 0 4 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