HttpRequestOptions::all()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
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