Passed
Push — master ( ebcc4e...0dd7c3 )
by Darío
06:39 queued 04:40
created

ClientRequest::options()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace EasyHttp\LayerContracts\Tests\Unit\Example;
4
5
use EasyHttp\LayerContracts\Contracts\HttpClientRequest;
6
7
class ClientRequest implements HttpClientRequest
8
{
9
    protected string $method;
10
    protected string $uri;
11
    protected array $json;
12
    protected array $query;
13
    protected array $headers;
14
    protected bool $ssl;
15
    protected array $options;
16
17
    public function getMethod(): string
18
    {
19
        return $this->method ?? '';
20
    }
21
22
    public function getUri(): string
23
    {
24
        return $this->uri ?? '';
25
    }
26
27
    public function getJson(): array
28
    {
29
        return $this->json ?? [];
30
    }
31
32
    public function getQuery(): array
33
    {
34
        return $this->query ?? [];
35
    }
36
37
    public function getHeader(string $key)
38
    {
39
        return $this->headers[$key] ?? '';
40
    }
41
42
    public function setMethod(string $method): HttpClientRequest
43
    {
44
        $this->method = $method;
45
46
        return $this;
47
    }
48
49
    public function setUri(string $uri): HttpClientRequest
50
    {
51
        $this->uri = $uri;
52
53
        return $this;
54
    }
55
56
    public function setHeader(string $key, string $value): HttpClientRequest
57
    {
58
        $this->headers[$key] = $value;
59
60
        return $this;
61
    }
62
63
    public function setJson(array $json): HttpClientRequest
64
    {
65
        $this->json = $json;
66
67
        return $this;
68
    }
69
70
    public function setQuery(array $query): HttpClientRequest
71
    {
72
        $this->query = $query;
73
74
        return $this;
75
    }
76
77
    public function ssl(bool $ssl): void
78
    {
79
        $this->ssl = $ssl;
80
    }
81
}
82