QueryResponse::__construct()   A
last analyzed

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