HttpRequestOptions   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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\DataTransferObject;
9
10
/**
11
 * Class HttpRequestOptions
12
 */
13
class HttpRequestOptions extends DataTransferObject
14
{
15
    /**
16
     * @var array<mixed>|string|null
17
     */
18
    public string|array|null $query = null;
19
20
    /**
21
     * @var array<mixed>|null
22
     */
23
    public ?array $headers = null;
24
25
    public ?string $body = null;
26
27
    public ?HandlerStack $handler = null;
28
29 1
    public function addHeader(string $key, mixed $value): void
30
    {
31 1
        $this->headers[$key] = $value;
32
    }
33
34
    /**
35
     * @return array<mixed>
36
     */
37 117
    public function all(): array
38
    {
39 117
        $array = parent::all();
40
41 117
        return array_filter($array);
42
    }
43
}
44