Http   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 22
rs 10
c 0
b 0
f 0
ccs 11
cts 11
cp 1
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A loadQuery() 0 3 1
A loadAnswer() 0 8 1
A loadParams() 0 3 1
1
<?php
2
3
namespace kalanis\RemoteRequest\Protocols;
4
5
6
use kalanis\RemoteRequest;
7
8
9
/**
10
 * Class Http
11
 * @package kalanis\RemoteRequest\Protocols
12
 * Properties for query to remote server - method HTTP
13
 */
14
class Http extends AProtocol
15
{
16
    public const DELIMITER = "\r\n";
17
18 4
    protected function loadParams(): RemoteRequest\Connection\Params\AParams
19
    {
20 4
        return new RemoteRequest\Connection\Params\Tcp();
21
    }
22
23 3
    protected function loadQuery(): RemoteRequest\Protocols\Dummy\Query
24
    {
25 3
        return new Http\Query();
26
    }
27
28 3
    protected function loadAnswer(): RemoteRequest\Protocols\Dummy\Answer
29
    {
30 3
        $lib = new Http\Answer($this->rrLang);
31 3
        $lib->addStringDecoding(new Http\Answer\DecodeStrings\Chunked());
32 3
        $lib->addStringDecoding(new Http\Answer\DecodeStrings\Zipped());
33 3
        $lib->addStringDecoding(new Http\Answer\DecodeStrings\Compressed());
34 3
        $lib->addStringDecoding(new Http\Answer\DecodeStrings\Deflated());
35 3
        return $lib;
36
    }
37
}
38