ArbitraryGranularity   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 6
dl 0
loc 14
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toArray() 0 7 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Level23\Druid\Granularities;
5
6
class ArbitraryGranularity extends AbstractGranularity implements GranularityInterface
7
{
8
    /**
9
     * Return the granularity in array format so that we can use it in a druid request.
10
     *
11
     * @return array<string,string|string[]|bool>
12
     */
13 2
    public function toArray(): array
14
    {
15 2
        return [
16 2
            'type'             => 'arbitrary',
17 2
            'queryGranularity' => $this->queryGranularity->value,
18 2
            'rollup'           => $this->rollup,
19 2
            'intervals'        => $this->intervals->toArray(),
20 2
        ];
21
    }
22
}