Passed
Push — remanufacture/json-object-deco... ( 07d964...ba9553 )
by Bas
03:04 queued 01:15
created

HttpRequestOptions::addHeader()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
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
 * @package ArangoClient\Http
14
 */
15
class HttpRequestOptions extends DataTransferObject
16
{
17
18
    /**
19
     * @var array<mixed>|string|null
20
     */
21
    public string|array|null $query = null;
0 ignored issues
show
Bug introduced by
The type ArangoClient\Http\null was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
22
23
    /**
24
     * @var array<mixed>|null
25
     */
26
    public ?array $headers = null;
27
28
    public ?string $body = null;
29
30
    public ?HandlerStack $handler = null;
31
32 1
    public function addHeader(string $key, mixed $value): void
33
    {
34 1
        $this->headers[$key] = $value;
35 1
    }
36
37
    /**
38
     * @return array<mixed>
39
     */
40 104
    public function all(): array
41
    {
42 104
        $array = parent::all();
43
44 104
        return array_filter($array);
45
    }
46
}
47