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

HttpRequestOptions   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 30
ccs 6
cts 6
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
 * @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