Total Complexity | 4 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
6 | class PrefixFilteredDimension implements DimensionInterface |
||
7 | { |
||
8 | protected Dimension $dimension; |
||
9 | |||
10 | protected string $prefix; |
||
11 | |||
12 | /** |
||
13 | * PrefixFilteredDimension constructor. |
||
14 | * |
||
15 | * @param Dimension $dimension |
||
16 | * @param string $prefix |
||
17 | */ |
||
18 | 1 | public function __construct(Dimension $dimension, string $prefix) |
|
19 | { |
||
20 | 1 | $this->dimension = $dimension; |
|
21 | 1 | $this->prefix = $prefix; |
|
22 | } |
||
23 | |||
24 | /** |
||
25 | * Return the dimension as it should be used in a druid query. |
||
26 | * |
||
27 | * @return array<string,string|array<mixed>> |
||
28 | */ |
||
29 | 1 | public function toArray(): array |
|
35 | ]; |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Return the name of the dimension which is selected. |
||
40 | * |
||
41 | * @return string |
||
42 | */ |
||
43 | 1 | public function getDimension(): string |
|
44 | { |
||
45 | 1 | return $this->dimension->getDimension(); |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * Return the output name of this dimension |
||
50 | * |
||
51 | * @return string |
||
52 | */ |
||
53 | 1 | public function getOutputName(): string |
|
56 | } |
||
57 | } |