Passed
Push — next ( c0af08...a29dc7 )
by Bas
01:58
created

HttpRequestOptions   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 8
c 1
b 0
f 0
dl 0
loc 33
ccs 6
cts 6
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A addHeader() 0 3 1
A all() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ArangoClient\Http;
6
7
use GuzzleHttp\HandlerStack;
8
use Spatie\DataTransferObject\FlexibleDataTransferObject;
9
10
/**
11
 * Class HttpRequestOptions
12
 *
13
 * @package ArangoClient\Http
14
 */
15
class HttpRequestOptions extends FlexibleDataTransferObject
16
{
17
    /**
18
     * @var array<mixed>|string|null
19
     */
20
    public $query;
21
22
    /**
23
     * @var array<mixed>|null
24
     */
25
    public ?array $headers = null;
26
27
    public ?string $body = null;
28
29
    public ?HandlerStack $handler = null;
30
31
    /**
32
     * @param  string  $key
33
     * @param mixed $value
34
     */
35 1
    public function addHeader(string $key, $value): void
36
    {
37 1
        $this->headers[$key] = $value;
38 1
    }
39
40
    /**
41
     * @return array<mixed>
42
     */
43 91
    public function all(): array
44
    {
45 91
        $array = parent::all();
46
47 91
        return array_filter($array);
48
    }
49
}
50