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

HttpRequestOptions::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

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 0
cts 3
cp 0
crap 2
rs 10
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