Completed
Push — master ( 740bbf...e6040b )
by Dmitry
02:33
created

Request::createWorker()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 13
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
crap 2
1
<?php
2
3
namespace hiqdev\hiart\httpclient;
4
5
/**
6
 * Class Request is a proxy for [[\yii\httpclient\Request]] class
7
 */
8
class Request extends \hiqdev\hiart\proxy\Request
9
{
10
    public $workerClass = \yii\httpclient\Request::class;
11
12
    public $handlerClass = \yii\httpclient\Client::class;
13
14
    public $responseClass = Response::class;
15
16
    public function createWorker()
17
    {
18
        return new $this->workerClass([
19
            'method' => $this->method,
20
            'url' => $this->getFullUri(),
21
            'headers' => $this->headers,
22
            'content' => $this->body,
23
            'client' => $this->getHandler(),
24
            'options' => [
25
                'protocolVersion' => $this->version,
26
            ],
27
        ]);
28
    }
29
}
30