@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | DataSourceInterface $dataSource, |
62 | 62 | DimensionCollection $dimensions, |
63 | 63 | IntervalCollection $intervals, |
64 | - array|AggregationCollection|null $aggregations = null, |
|
65 | - string|Granularity $granularity = 'all' |
|
64 | + array | AggregationCollection | null $aggregations = null, |
|
65 | + string | Granularity $granularity = 'all' |
|
66 | 66 | ) { |
67 | 67 | $this->dataSource = $dataSource; |
68 | 68 | $this->dimensions = $dimensions; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | /** |
139 | 139 | * @param \Level23\Druid\Collections\AggregationCollection|array<AggregatorInterface> $aggregations |
140 | 140 | */ |
141 | - public function setAggregations(array|AggregationCollection $aggregations): void |
|
141 | + public function setAggregations(array | AggregationCollection $aggregations): void |
|
142 | 142 | { |
143 | 143 | if (is_array($aggregations)) { |
144 | 144 | $aggregations = new AggregationCollection(...$aggregations); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | /** |
151 | 151 | * @param \Level23\Druid\Collections\PostAggregationCollection|array<PostAggregatorInterface> $postAggregations |
152 | 152 | */ |
153 | - public function setPostAggregations(PostAggregationCollection|array $postAggregations): void |
|
153 | + public function setPostAggregations(PostAggregationCollection | array $postAggregations): void |
|
154 | 154 | { |
155 | 155 | if (is_array($postAggregations)) { |
156 | 156 | $postAggregations = new PostAggregationCollection(...$postAggregations); |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | /** |
179 | 179 | * @param \Level23\Druid\Limits\Limit|int $limit |
180 | 180 | */ |
181 | - public function setLimit(Limit|int $limit): void |
|
181 | + public function setLimit(Limit | int $limit): void |
|
182 | 182 | { |
183 | 183 | if ($limit instanceof LimitInterface) { |
184 | 184 | $this->limit = $limit; |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | * @throws \Exception |
86 | 86 | */ |
87 | 87 | public function timeBoundary( |
88 | - string|DataSourceInterface $dataSource, |
|
89 | - null|string|TimeBound $bound = TimeBound::BOTH, |
|
88 | + string | DataSourceInterface $dataSource, |
|
89 | + null | string | TimeBound $bound = TimeBound::BOTH, |
|
90 | 90 | ?Closure $filterBuilder = null, |
91 | 91 | ?ContextInterface $context = null |
92 | - ): DateTime|array { |
|
92 | + ): DateTime | array { |
|
93 | 93 | |
94 | 94 | $query = [ |
95 | 95 | 'queryType' => 'timeBoundary', |
@@ -301,8 +301,8 @@ discard block |
||
301 | 301 | */ |
302 | 302 | protected function getColumnsForInterval( |
303 | 303 | string $dataSource, |
304 | - DateTimeInterface|int|string $start, |
|
305 | - DateTimeInterface|int|string|null $stop = null |
|
304 | + DateTimeInterface | int | string $start, |
|
305 | + DateTimeInterface | int | string | null $stop = null |
|
306 | 306 | ): array { |
307 | 307 | $response = $this->client->query($dataSource) |
308 | 308 | ->interval($start, $stop) |
@@ -343,8 +343,8 @@ discard block |
||
343 | 343 | */ |
344 | 344 | public function rowCount( |
345 | 345 | string $dataSource, |
346 | - DateTimeInterface|int|string $start, |
|
347 | - DateTimeInterface|int|string|null $stop = null |
|
346 | + DateTimeInterface | int | string $start, |
|
347 | + DateTimeInterface | int | string | null $stop = null |
|
348 | 348 | ): int { |
349 | 349 | $response = $this->client->query($dataSource) |
350 | 350 | ->interval($start, $stop) |
@@ -50,7 +50,7 @@ |
||
50 | 50 | * @return $this |
51 | 51 | * @throws \Exception |
52 | 52 | */ |
53 | - public function interval(DateTimeInterface|int|string $start, DateTimeInterface|int|string|null $stop = null): self |
|
53 | + public function interval(DateTimeInterface | int | string $start, DateTimeInterface | int | string | null $stop = null): self |
|
54 | 54 | { |
55 | 55 | $this->intervals[] = new Interval($start, $stop); |
56 | 56 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | public function sum( |
58 | 58 | string $metric, |
59 | 59 | string $as = '', |
60 | - string|DataType $type = DataType::LONG, |
|
60 | + string | DataType $type = DataType::LONG, |
|
61 | 61 | ?Closure $filterBuilder = null |
62 | 62 | ): self { |
63 | 63 | $this->aggregations[] = $this->buildFilteredAggregation( |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function cardinality( |
238 | 238 | string $as, |
239 | - array|Closure $dimensionsOrDimensionBuilder, |
|
239 | + array | Closure $dimensionsOrDimensionBuilder, |
|
240 | 240 | bool $byRow = false, |
241 | 241 | bool $round = false |
242 | 242 | ): self { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | public function min( |
355 | 355 | string $metric, |
356 | 356 | string $as = '', |
357 | - string|DataType $type = DataType::LONG, |
|
357 | + string | DataType $type = DataType::LONG, |
|
358 | 358 | ?Closure $filterBuilder = null |
359 | 359 | ): self { |
360 | 360 | $this->aggregations[] = $this->buildFilteredAggregation( |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | public function max( |
425 | 425 | string $metric, |
426 | 426 | string $as = '', |
427 | - string|DataType $type = DataType::LONG, |
|
427 | + string | DataType $type = DataType::LONG, |
|
428 | 428 | ?Closure $filterBuilder = null |
429 | 429 | ): self { |
430 | 430 | $this->aggregations[] = $this->buildFilteredAggregation( |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | public function any( |
500 | 500 | string $metric, |
501 | 501 | string $as = '', |
502 | - string|DataType $type = DataType::LONG, |
|
502 | + string | DataType $type = DataType::LONG, |
|
503 | 503 | ?int $maxStringBytes = null, |
504 | 504 | ?Closure $filterBuilder = null |
505 | 505 | ): self { |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | public function first( |
610 | 610 | string $metric, |
611 | 611 | string $as = '', |
612 | - string|DataType $type = DataType::LONG, |
|
612 | + string | DataType $type = DataType::LONG, |
|
613 | 613 | ?Closure $filterBuilder = null |
614 | 614 | ): self { |
615 | 615 | $this->aggregations[] = $this->buildFilteredAggregation( |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | public function last( |
707 | 707 | string $metric, |
708 | 708 | string $as = '', |
709 | - string|DataType $type = DataType::LONG, |
|
709 | + string | DataType $type = DataType::LONG, |
|
710 | 710 | ?Closure $filterBuilder = null |
711 | 711 | ): self { |
712 | 712 | $this->aggregations[] = $this->buildFilteredAggregation( |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | * @return $this |
61 | 61 | */ |
62 | 62 | public function where( |
63 | - Closure|string|FilterInterface $filterOrDimensionOrClosure, |
|
64 | - int|string|float|bool|null $operator = null, |
|
65 | - array|int|string|float|bool|null $value = null, |
|
63 | + Closure | string | FilterInterface $filterOrDimensionOrClosure, |
|
64 | + int | string | float | bool | null $operator = null, |
|
65 | + array | int | string | float | bool | null $value = null, |
|
66 | 66 | string $boolean = 'and' |
67 | 67 | ): self { |
68 | 68 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * @see https://druid.apache.org/docs/latest/querying/filters/#array-contains-element-filter |
244 | 244 | * |
245 | 245 | */ |
246 | - public function whereArrayContains(string $column, int|float|string|null $value, string $boolean = 'and'): self |
|
246 | + public function whereArrayContains(string $column, int | float | string | null $value, string $boolean = 'and'): self |
|
247 | 247 | { |
248 | 248 | $filter = new ArrayContainsFilter($column, $value); |
249 | 249 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * |
260 | 260 | * @return $this |
261 | 261 | */ |
262 | - public function orWhereArrayContains(string $column, int|float|string|null $value): self |
|
262 | + public function orWhereArrayContains(string $column, int | float | string | null $value): self |
|
263 | 263 | { |
264 | 264 | return $this->whereArrayContains($column, $value, 'or'); |
265 | 265 | } |
@@ -315,9 +315,9 @@ discard block |
||
315 | 315 | * @see \Level23\Druid\Concerns\HasFilter::where() |
316 | 316 | */ |
317 | 317 | public function orWhere( |
318 | - string|FilterInterface|Closure $filterOrDimension, |
|
319 | - string|int|float|bool|null $operator = null, |
|
320 | - array|int|float|string|bool|null $value = null |
|
318 | + string | FilterInterface | Closure $filterOrDimension, |
|
319 | + string | int | float | bool | null $operator = null, |
|
320 | + array | int | float | string | bool | null $value = null |
|
321 | 321 | ): self { |
322 | 322 | return $this->where($filterOrDimension, $operator, $value, 'or'); |
323 | 323 | } |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | * |
440 | 440 | * @return $this |
441 | 441 | */ |
442 | - public function whereColumn(Closure|string $dimensionA, Closure|string $dimensionB, string $boolean = 'and'): self |
|
442 | + public function whereColumn(Closure | string $dimensionA, Closure | string $dimensionB, string $boolean = 'and'): self |
|
443 | 443 | { |
444 | 444 | $filter = new ColumnComparisonFilter( |
445 | 445 | $this->columnCompareDimension($dimensionA), |
@@ -468,7 +468,7 @@ discard block |
||
468 | 468 | * |
469 | 469 | * @return $this |
470 | 470 | */ |
471 | - public function orWhereColumn(Closure|string $dimensionA, Closure|string $dimensionB): self |
|
471 | + public function orWhereColumn(Closure | string $dimensionA, Closure | string $dimensionB): self |
|
472 | 472 | { |
473 | 473 | return $this->whereColumn($dimensionA, $dimensionB, 'or'); |
474 | 474 | } |
@@ -499,8 +499,8 @@ discard block |
||
499 | 499 | */ |
500 | 500 | public function whereBetween( |
501 | 501 | string $dimension, |
502 | - int|float|string $minValue, |
|
503 | - int|float|string $maxValue, |
|
502 | + int | float | string $minValue, |
|
503 | + int | float | string $maxValue, |
|
504 | 504 | ?DataType $valueType = null, |
505 | 505 | string $boolean = 'and' |
506 | 506 | ): self { |
@@ -534,8 +534,8 @@ discard block |
||
534 | 534 | */ |
535 | 535 | public function orWhereBetween( |
536 | 536 | string $dimension, |
537 | - int|float|string $minValue, |
|
538 | - int|float|string $maxValue, |
|
537 | + int | float | string $minValue, |
|
538 | + int | float | string $maxValue, |
|
539 | 539 | ?DataType $valueType = null |
540 | 540 | ): self { |
541 | 541 | return $this->whereBetween($dimension, $minValue, $maxValue, $valueType, 'or'); |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | * @return \Level23\Druid\Dimensions\DimensionInterface |
786 | 786 | * @throws InvalidArgumentException |
787 | 787 | */ |
788 | - protected function columnCompareDimension(Closure|string $dimension): DimensionInterface |
|
788 | + protected function columnCompareDimension(Closure | string $dimension): DimensionInterface |
|
789 | 789 | { |
790 | 790 | if ($dimension instanceof Closure) { |
791 | 791 | $builder = new DimensionBuilder(); |
@@ -51,7 +51,7 @@ |
||
51 | 51 | * @return $this |
52 | 52 | * @throws \Exception |
53 | 53 | */ |
54 | - public function interval(DateTimeInterface|int|string $start, DateTimeInterface|int|string|null $stop = null): self |
|
54 | + public function interval(DateTimeInterface | int | string $start, DateTimeInterface | int | string | null $stop = null): self |
|
55 | 55 | { |
56 | 56 | $this->interval = new Interval($start, $stop); |
57 | 57 |
@@ -35,9 +35,9 @@ discard block |
||
35 | 35 | * @return $this |
36 | 36 | */ |
37 | 37 | public function having( |
38 | - Closure|string|HavingFilterInterface|FilterInterface $havingOrMetricOrClosure, |
|
39 | - float|string|null $operator = null, |
|
40 | - float|string|bool|null $value = null, |
|
38 | + Closure | string | HavingFilterInterface | FilterInterface $havingOrMetricOrClosure, |
|
39 | + float | string | null $operator = null, |
|
40 | + float | string | bool | null $value = null, |
|
41 | 41 | string $boolean = 'and' |
42 | 42 | ): self { |
43 | 43 | $having = null; |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | * @return $this |
110 | 110 | */ |
111 | 111 | public function orHaving( |
112 | - Closure|HavingFilterInterface|string $havingOrMetricOrClosure, |
|
113 | - float|string|null $operator = null, |
|
114 | - float|string|null $value = null |
|
112 | + Closure | HavingFilterInterface | string $havingOrMetricOrClosure, |
|
113 | + float | string | null $operator = null, |
|
114 | + float | string | null $value = null |
|
115 | 115 | ): self { |
116 | 116 | return $this->having($havingOrMetricOrClosure, $operator, $value, 'or'); |
117 | 117 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | * |
24 | 24 | * @throws \Exception |
25 | 25 | */ |
26 | - public function __construct(DateTimeInterface|int|string $start, DateTimeInterface|int|string|null $stop = null) |
|
26 | + public function __construct(DateTimeInterface | int | string $start, DateTimeInterface | int | string | null $stop = null) |
|
27 | 27 | { |
28 | 28 | // Check if we received a "raw" interval string, like 2019-04-15T08:00:00.000Z/2019-04-15T09:00:00.000Z |
29 | 29 | if (is_string($start) && $stop === null) { |