Total Complexity | 2 |
Total Lines | 42 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | class SpatialRadiusFilter implements FilterInterface |
||
12 | { |
||
13 | protected string $dimension; |
||
14 | |||
15 | /** |
||
16 | * @var float[] |
||
17 | */ |
||
18 | protected array $coords; |
||
19 | |||
20 | protected float $radius; |
||
21 | |||
22 | /** |
||
23 | * SpatialRadiusFilter constructor. |
||
24 | * |
||
25 | * @param string $dimension The dimension to filter on |
||
26 | * @param float[] $coords Origin coordinates in the form [x, y, z, …] |
||
27 | * @param float $radius The float radius value |
||
28 | */ |
||
29 | 1 | public function __construct( |
|
30 | string $dimension, |
||
31 | array $coords, |
||
32 | float $radius |
||
33 | ) { |
||
34 | 1 | $this->dimension = $dimension; |
|
35 | 1 | $this->coords = $coords; |
|
36 | 1 | $this->radius = $radius; |
|
37 | } |
||
38 | |||
39 | /** |
||
40 | * Return the filter as it can be used in the druid query. |
||
41 | * |
||
42 | * @return array<string,string|array<string,string|float|float[]>> |
||
43 | */ |
||
44 | 1 | public function toArray(): array |
|
53 | ], |
||
54 | ]; |
||
56 | } |