Http::loadAnswer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 0
dl 0
loc 8
rs 10
c 0
b 0
f 0
ccs 7
cts 7
cp 1
crap 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