Request   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 37
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
1
<?php
2
namespace Qiniu\Http;
3
4
final class Request
5
{
6
    /**
7
     * @var string
8
     */
9
    public $url;
10
11 102
    /**
12
     * @var array<string, string>
13 102
     */
14 102
    public $headers;
15 102
16 102
    /**
17 102
     * @var mixed|null
18
     */
19
    public $body;
20
21
    /**
22
     * @var string
23
     */
24
    public $method;
25
26
    /**
27
     * @var RequestOptions
28
     */
29
    public $opt;
30
31
    public function __construct($method, $url, array $headers = array(), $body = null, $opt = null)
32
    {
33
        $this->method = strtoupper($method);
34
        $this->url = $url;
35
        $this->headers = $headers;
36
        $this->body = $body;
37
        if ($opt === null) {
38
            $opt = new RequestOptions();
39
        }
40
        $this->opt = $opt;
41
    }
42
}
43