| Total Complexity | 3 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class SegmentMetadataQuery implements QueryInterface |
||
| 11 | { |
||
| 12 | protected DataSourceInterface $dataSource; |
||
| 13 | |||
| 14 | protected IntervalCollection $intervals; |
||
| 15 | |||
| 16 | 1 | public function __construct(DataSourceInterface $dataSource, IntervalCollection $intervals) |
|
| 17 | { |
||
| 18 | 1 | $this->dataSource = $dataSource; |
|
| 19 | 1 | $this->intervals = $intervals; |
|
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Return the query in array format, so we can fire it to druid. |
||
| 24 | * |
||
| 25 | * @return array<string,array<int|string,array<string>|string>|string> |
||
| 26 | */ |
||
| 27 | 1 | public function toArray(): array |
|
| 28 | { |
||
| 29 | 1 | return [ |
|
| 30 | 1 | 'queryType' => 'segmentMetadata', |
|
| 31 | 1 | 'dataSource' => $this->dataSource->toArray(), |
|
| 32 | 1 | 'intervals' => $this->intervals->toArray(), |
|
| 33 | 1 | ]; |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Parse the response into something we can return to the user. |
||
| 38 | * |
||
| 39 | * @param array<string|int,array<mixed>|int|string> $response |
||
| 40 | * |
||
| 41 | * @return SegmentMetadataQueryResponse |
||
| 42 | */ |
||
| 43 | 1 | public function parseResponse(array $response): SegmentMetadataQueryResponse |
|
| 46 | } |
||
| 47 | } |