QueryResponse   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A raw() 0 3 1
A __construct() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Level23\Druid\Responses;
5
6
abstract class QueryResponse implements ResponseInterface
7
{
8
    /**
9
     * @var array<mixed>
10
     */
11
    protected array $response;
12
13
    /**
14
     * @param array<mixed> $response
15
     */
16 31
    public function __construct(array $response)
17
    {
18 31
        $this->response = $response;
19
    }
20
21
    /**
22
     * Return the raw response as we have received it from druid.
23
     *
24
     * @return array<mixed>
25
     */
26 11
    public function raw(): array
27
    {
28 11
        return $this->response;
29
    }
30
31
    /**
32
     * Return the data in a "normalized" way, so we can easily iterate over it
33
     *
34
     * @return array<array<mixed>>
35
     */
36
    abstract public function data(): array;
37
}