@@ -13,13 +13,13 @@ |
||
| 13 | 13 | |
| 14 | 14 | protected ?string $ordering; |
| 15 | 15 | |
| 16 | - protected DataType|string|null $outputType; |
|
| 16 | + protected DataType | string | null $outputType; |
|
| 17 | 17 | |
| 18 | 18 | public function __construct( |
| 19 | 19 | string $outputName, |
| 20 | 20 | string $expression, |
| 21 | 21 | ?string $ordering = null, |
| 22 | - DataType|string|null $outputType = null |
|
| 22 | + DataType | string | null $outputType = null |
|
| 23 | 23 | |
| 24 | 24 | ) { |
| 25 | 25 | $this->outputName = $outputName; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * |
| 118 | 118 | * @return $this |
| 119 | 119 | */ |
| 120 | - public function quantile(string $as, Closure|string $fieldOrClosure, float $fraction): self |
|
| 120 | + public function quantile(string $as, Closure | string $fieldOrClosure, float $fraction): self |
|
| 121 | 121 | { |
| 122 | 122 | $fields = $this->buildFields([$fieldOrClosure]); |
| 123 | 123 | if ($fields->count() != 1 || !$fields[0]) { |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | * |
| 153 | 153 | * @return $this |
| 154 | 154 | */ |
| 155 | - public function quantiles(string $as, Closure|string $fieldOrClosure, array $fractions): self |
|
| 155 | + public function quantiles(string $as, Closure | string $fieldOrClosure, array $fractions): self |
|
| 156 | 156 | { |
| 157 | 157 | $fields = $this->buildFields([$fieldOrClosure]); |
| 158 | 158 | if ($fields->count() != 1 || !$fields[0]) { |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public function histogram( |
| 195 | 195 | string $as, |
| 196 | - Closure|string $fieldOrClosure, |
|
| 196 | + Closure | string $fieldOrClosure, |
|
| 197 | 197 | ?array $splitPoints = null, |
| 198 | 198 | ?int $numBins = null |
| 199 | 199 | ): self { |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | * |
| 232 | 232 | * @return $this |
| 233 | 233 | */ |
| 234 | - public function rank(string $as, Closure|string $fieldOrClosure, float|int $value): self |
|
| 234 | + public function rank(string $as, Closure | string $fieldOrClosure, float | int $value): self |
|
| 235 | 235 | { |
| 236 | 236 | $fields = $this->buildFields([$fieldOrClosure]); |
| 237 | 237 | if ($fields->count() != 1 || !$fields[0]) { |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | * |
| 269 | 269 | * @return $this |
| 270 | 270 | */ |
| 271 | - public function cdf(string $as, Closure|string $fieldOrClosure, array $splitPoints): self |
|
| 271 | + public function cdf(string $as, Closure | string $fieldOrClosure, array $splitPoints): self |
|
| 272 | 272 | { |
| 273 | 273 | $fields = $this->buildFields([$fieldOrClosure]); |
| 274 | 274 | if ($fields->count() != 1 || !$fields[0]) { |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | * |
| 302 | 302 | * @return $this |
| 303 | 303 | */ |
| 304 | - public function sketchSummary(string $as, Closure|string $fieldOrClosure): self |
|
| 304 | + public function sketchSummary(string $as, Closure | string $fieldOrClosure): self |
|
| 305 | 305 | { |
| 306 | 306 | $fields = $this->buildFields([$fieldOrClosure]); |
| 307 | 307 | if ($fields->count() != 1 || !$fields[0]) { |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | * |
| 452 | 452 | * @return $this |
| 453 | 453 | */ |
| 454 | - public function constant(float|int $numericValue, string $as): self |
|
| 454 | + public function constant(float | int $numericValue, string $as): self |
|
| 455 | 455 | { |
| 456 | 456 | $this->postAggregations[] = new ConstantPostAggregator($as, $numericValue); |
| 457 | 457 | |
@@ -630,7 +630,7 @@ discard block |
||
| 630 | 630 | string $as, |
| 631 | 631 | string $expression, |
| 632 | 632 | ?string $ordering = null, |
| 633 | - DataType|string|null $outputType = null |
|
| 633 | + DataType | string | null $outputType = null |
|
| 634 | 634 | ): self { |
| 635 | 635 | $this->postAggregations[] = new ExpressionPostAggregator( |
| 636 | 636 | $as, |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | public function __construct( |
| 102 | 102 | DruidClient $client, |
| 103 | 103 | string $dataSource = '', |
| 104 | - string|Granularity $granularity = Granularity::ALL |
|
| 104 | + string | Granularity $granularity = Granularity::ALL |
|
| 105 | 105 | ) { |
| 106 | 106 | $this->client = $client; |
| 107 | 107 | $this->query = $this; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * @return $this |
| 125 | 125 | * @see https://druid.apache.org/docs/latest/misc/math-expr.html |
| 126 | 126 | */ |
| 127 | - public function selectVirtual(string $expression, string $as, string|DataType $outputType = DataType::STRING): self |
|
| 127 | + public function selectVirtual(string $expression, string $as, string | DataType $outputType = DataType::STRING): self |
|
| 128 | 128 | { |
| 129 | 129 | $this->virtualColumn($expression, $as, $outputType); |
| 130 | 130 | $this->select($as, $as, $outputType); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | * @throws \Level23\Druid\Exceptions\QueryResponseException |
| 142 | 142 | * @throws \GuzzleHttp\Exception\GuzzleException |
| 143 | 143 | */ |
| 144 | - public function execute(array|QueryContext $context = []): QueryResponse |
|
| 144 | + public function execute(array | QueryContext $context = []): QueryResponse |
|
| 145 | 145 | { |
| 146 | 146 | $query = $this->getQuery($context); |
| 147 | 147 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | * |
| 158 | 158 | * @return $this |
| 159 | 159 | */ |
| 160 | - public function granularity(string|Granularity $granularity): QueryBuilder |
|
| 160 | + public function granularity(string | Granularity $granularity): QueryBuilder |
|
| 161 | 161 | { |
| 162 | 162 | $this->granularity = is_string($granularity) ? Granularity::from(strtolower($granularity)) : $granularity; |
| 163 | 163 | |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * @return string |
| 249 | 249 | * @throws \InvalidArgumentException if the JSON cannot be encoded. |
| 250 | 250 | */ |
| 251 | - public function toJson(array|QueryContext $context = []): string |
|
| 251 | + public function toJson(array | QueryContext $context = []): string |
|
| 252 | 252 | { |
| 253 | 253 | $query = $this->getQuery($context); |
| 254 | 254 | |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * |
| 263 | 263 | * @return array<string,array<mixed>|string|int> |
| 264 | 264 | */ |
| 265 | - public function toArray(array|QueryContext $context = []): array |
|
| 265 | + public function toArray(array | QueryContext $context = []): array |
|
| 266 | 266 | { |
| 267 | 267 | return $this->getQuery($context)->toArray(); |
| 268 | 268 | } |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | * @throws \Level23\Druid\Exceptions\QueryResponseException |
| 277 | 277 | * @throws \GuzzleHttp\Exception\GuzzleException |
| 278 | 278 | */ |
| 279 | - public function timeseries(array|TimeSeriesQueryContext $context = []): TimeSeriesQueryResponse |
|
| 279 | + public function timeseries(array | TimeSeriesQueryContext $context = []): TimeSeriesQueryResponse |
|
| 280 | 280 | { |
| 281 | 281 | $query = $this->buildTimeSeriesQuery($context); |
| 282 | 282 | |
@@ -305,10 +305,10 @@ discard block |
||
| 305 | 305 | * @throws \GuzzleHttp\Exception\GuzzleException |
| 306 | 306 | */ |
| 307 | 307 | public function scan( |
| 308 | - array|ScanQueryContext $context = [], |
|
| 308 | + array | ScanQueryContext $context = [], |
|
| 309 | 309 | ?int $rowBatchSize = null, |
| 310 | 310 | bool $legacy = false, |
| 311 | - string|ScanQueryResultFormat $resultFormat = ScanQueryResultFormat::NORMAL_LIST |
|
| 311 | + string | ScanQueryResultFormat $resultFormat = ScanQueryResultFormat::NORMAL_LIST |
|
| 312 | 312 | ): ScanQueryResponse { |
| 313 | 313 | $query = $this->buildScanQuery($context, $rowBatchSize, $legacy, $resultFormat); |
| 314 | 314 | |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | * @throws \Level23\Druid\Exceptions\QueryResponseException |
| 327 | 327 | * @throws \GuzzleHttp\Exception\GuzzleException |
| 328 | 328 | */ |
| 329 | - public function selectQuery(array|QueryContext $context = []): SelectQueryResponse |
|
| 329 | + public function selectQuery(array | QueryContext $context = []): SelectQueryResponse |
|
| 330 | 330 | { |
| 331 | 331 | $query = $this->buildSelectQuery($context); |
| 332 | 332 | |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | * @throws \Level23\Druid\Exceptions\QueryResponseException |
| 345 | 345 | * @throws \GuzzleHttp\Exception\GuzzleException |
| 346 | 346 | */ |
| 347 | - public function topN(array|TopNQueryContext $context = []): TopNQueryResponse |
|
| 347 | + public function topN(array | TopNQueryContext $context = []): TopNQueryResponse |
|
| 348 | 348 | { |
| 349 | 349 | $query = $this->buildTopNQuery($context); |
| 350 | 350 | |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | * @throws \Level23\Druid\Exceptions\QueryResponseException |
| 363 | 363 | * @throws \GuzzleHttp\Exception\GuzzleException |
| 364 | 364 | */ |
| 365 | - public function groupBy(array|GroupByQueryContext $context = []): GroupByQueryResponse |
|
| 365 | + public function groupBy(array | GroupByQueryContext $context = []): GroupByQueryResponse |
|
| 366 | 366 | { |
| 367 | 367 | $query = $this->buildGroupByQuery($context); |
| 368 | 368 | |
@@ -382,8 +382,8 @@ discard block |
||
| 382 | 382 | * @throws \Level23\Druid\Exceptions\QueryResponseException |
| 383 | 383 | */ |
| 384 | 384 | public function search( |
| 385 | - array|QueryContext $context = [], |
|
| 386 | - string|SortingOrder $sortingOrder = SortingOrder::LEXICOGRAPHIC |
|
| 385 | + array | QueryContext $context = [], |
|
| 386 | + string | SortingOrder $sortingOrder = SortingOrder::LEXICOGRAPHIC |
|
| 387 | 387 | ): SearchQueryResponse { |
| 388 | 388 | $query = $this->buildSearchQuery($context, $sortingOrder); |
| 389 | 389 | |
@@ -438,8 +438,8 @@ discard block |
||
| 438 | 438 | * @return \Level23\Druid\Queries\SearchQuery |
| 439 | 439 | */ |
| 440 | 440 | protected function buildSearchQuery( |
| 441 | - array|QueryContext $context = [], |
|
| 442 | - string|SortingOrder $sortingOrder = SortingOrder::LEXICOGRAPHIC |
|
| 441 | + array | QueryContext $context = [], |
|
| 442 | + string | SortingOrder $sortingOrder = SortingOrder::LEXICOGRAPHIC |
|
| 443 | 443 | ): SearchQuery { |
| 444 | 444 | if (count($this->intervals) == 0) { |
| 445 | 445 | throw new InvalidArgumentException('You have to specify at least one interval'); |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | * |
| 489 | 489 | * @return \Level23\Druid\Queries\SelectQuery |
| 490 | 490 | */ |
| 491 | - protected function buildSelectQuery(array|QueryContext $context = []): SelectQuery |
|
| 491 | + protected function buildSelectQuery(array | QueryContext $context = []): SelectQuery |
|
| 492 | 492 | { |
| 493 | 493 | if (count($this->intervals) == 0) { |
| 494 | 494 | throw new InvalidArgumentException('You have to specify at least one interval'); |
@@ -540,10 +540,10 @@ discard block |
||
| 540 | 540 | * @return \Level23\Druid\Queries\ScanQuery |
| 541 | 541 | */ |
| 542 | 542 | protected function buildScanQuery( |
| 543 | - array|QueryContext $context = [], |
|
| 543 | + array | QueryContext $context = [], |
|
| 544 | 544 | ?int $rowBatchSize = null, |
| 545 | 545 | bool $legacy = false, |
| 546 | - string|ScanQueryResultFormat $resultFormat = ScanQueryResultFormat::NORMAL_LIST |
|
| 546 | + string | ScanQueryResultFormat $resultFormat = ScanQueryResultFormat::NORMAL_LIST |
|
| 547 | 547 | ): ScanQuery { |
| 548 | 548 | if (count($this->intervals) == 0) { |
| 549 | 549 | throw new InvalidArgumentException('You have to specify at least one interval'); |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | * |
| 622 | 622 | * @return TimeSeriesQuery |
| 623 | 623 | */ |
| 624 | - protected function buildTimeSeriesQuery(array|QueryContext $context = []): TimeSeriesQuery |
|
| 624 | + protected function buildTimeSeriesQuery(array | QueryContext $context = []): TimeSeriesQuery |
|
| 625 | 625 | { |
| 626 | 626 | if (count($this->intervals) == 0) { |
| 627 | 627 | throw new InvalidArgumentException('You have to specify at least one interval'); |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | * |
| 690 | 690 | * @return TopNQuery |
| 691 | 691 | */ |
| 692 | - protected function buildTopNQuery(array|QueryContext $context = []): TopNQuery |
|
| 692 | + protected function buildTopNQuery(array | QueryContext $context = []): TopNQuery |
|
| 693 | 693 | { |
| 694 | 694 | if (count($this->intervals) == 0) { |
| 695 | 695 | throw new InvalidArgumentException('You have to specify at least one interval'); |
@@ -761,7 +761,7 @@ discard block |
||
| 761 | 761 | * |
| 762 | 762 | * @return GroupByQuery |
| 763 | 763 | */ |
| 764 | - protected function buildGroupByQuery(array|QueryContext $context = []): GroupByQuery |
|
| 764 | + protected function buildGroupByQuery(array | QueryContext $context = []): GroupByQuery |
|
| 765 | 765 | { |
| 766 | 766 | if (count($this->intervals) == 0) { |
| 767 | 767 | throw new InvalidArgumentException('You have to specify at least one interval'); |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | * |
| 816 | 816 | * @return \Level23\Druid\Queries\QueryInterface |
| 817 | 817 | */ |
| 818 | - public function getQuery(array|QueryContext $context = []): QueryInterface |
|
| 818 | + public function getQuery(array | QueryContext $context = []): QueryInterface |
|
| 819 | 819 | { |
| 820 | 820 | // Check if this is a scan query. This is the preferred way to query when there are |
| 821 | 821 | // no aggregations done. |
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | * @return self |
| 48 | 48 | */ |
| 49 | 49 | public function select( |
| 50 | - array|ArrayObject|string|DimensionInterface $dimension, |
|
| 50 | + array | ArrayObject | string | DimensionInterface $dimension, |
|
| 51 | 51 | string $as = '', |
| 52 | - string|DataType $outputType = DataType::STRING |
|
| 52 | + string | DataType $outputType = DataType::STRING |
|
| 53 | 53 | ): self { |
| 54 | 54 | if (is_string($dimension)) { |
| 55 | 55 | $this->addDimension(new Dimension( |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | string $lookupFunction, |
| 83 | 83 | string $dimension, |
| 84 | 84 | string $as = '', |
| 85 | - bool|string $keepMissingValue = false |
|
| 85 | + bool | string $keepMissingValue = false |
|
| 86 | 86 | ): self { |
| 87 | 87 | $this->addDimension(new LookupDimension( |
| 88 | 88 | $dimension, |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | array $map, |
| 117 | 117 | string $dimension, |
| 118 | 118 | string $as = '', |
| 119 | - bool|string $keepMissingValue = false, |
|
| 119 | + bool | string $keepMissingValue = false, |
|
| 120 | 120 | bool $isOneToOne = false |
| 121 | 121 | ): self { |
| 122 | 122 | $this->addDimension(new LookupDimension( |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | string $dimension, |
| 150 | 150 | array $values, |
| 151 | 151 | string $as = '', |
| 152 | - string|DataType $outputType = DataType::STRING, |
|
| 152 | + string | DataType $outputType = DataType::STRING, |
|
| 153 | 153 | bool $isWhitelist = true |
| 154 | 154 | ): self { |
| 155 | 155 | $this->addDimension(new ListFilteredDimension( |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | string $dimension, |
| 185 | 185 | string $regex, |
| 186 | 186 | string $as = '', |
| 187 | - string|DataType $outputType = DataType::STRING |
|
| 187 | + string | DataType $outputType = DataType::STRING |
|
| 188 | 188 | ): self { |
| 189 | 189 | $this->addDimension(new RegexFilteredDimension( |
| 190 | 190 | new Dimension( |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | string $dimension, |
| 216 | 216 | string $prefix, |
| 217 | 217 | string $as = '', |
| 218 | - string|DataType $outputType = DataType::STRING |
|
| 218 | + string | DataType $outputType = DataType::STRING |
|
| 219 | 219 | ): self { |
| 220 | 220 | $this->addDimension(new PrefixFilteredDimension( |
| 221 | 221 | new Dimension( |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * |
| 235 | 235 | * @param ArrayObject<int|string,string>|string|DimensionInterface|array<int,string> $dimension |
| 236 | 236 | */ |
| 237 | - protected function addDimension(array|ArrayObject|string|DimensionInterface $dimension): void |
|
| 237 | + protected function addDimension(array | ArrayObject | string | DimensionInterface $dimension): void |
|
| 238 | 238 | { |
| 239 | 239 | if ($dimension instanceof DimensionInterface) { |
| 240 | 240 | $this->dimensions[] = $dimension; |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * @var string|string[] |
| 19 | 19 | */ |
| 20 | - protected string|array $value; |
|
| 20 | + protected string | array $value; |
|
| 21 | 21 | |
| 22 | 22 | protected bool $caseSensitive; |
| 23 | 23 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function __construct( |
| 35 | 35 | string $dimension, |
| 36 | - array|string $valueOrValues, |
|
| 36 | + array | string $valueOrValues, |
|
| 37 | 37 | bool $caseSensitive = false |
| 38 | 38 | ) { |
| 39 | 39 | $this->dimension = $dimension; |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | public function __construct( |
| 14 | 14 | protected ParseSpecInterface $parseSpec, |
| 15 | 15 | protected string $uri, |
| 16 | - protected null|int|string $pollPeriod = null, |
|
| 16 | + protected null | int | string $pollPeriod = null, |
|
| 17 | 17 | protected ?int $maxHeapPercentage = null, |
| 18 | 18 | protected bool $injective = false, |
| 19 | 19 | protected int $firstCacheTimeoutMs = 0 |
@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function __construct( |
| 50 | 50 | protected string $connectUri, |
| 51 | - protected string|null $username, |
|
| 52 | - protected string|null $password, |
|
| 51 | + protected string | null $username, |
|
| 52 | + protected string | null $password, |
|
| 53 | 53 | protected string $table, |
| 54 | 54 | protected string $keyColumn, |
| 55 | 55 | protected string $valueColumn, |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | protected ?string $tsColumn = null, |
| 58 | 58 | protected ?int $jitterSeconds = null, |
| 59 | 59 | protected ?int $loadTimeoutSeconds = null, |
| 60 | - protected null|int|string $pollPeriod = null, |
|
| 60 | + protected null | int | string $pollPeriod = null, |
|
| 61 | 61 | protected ?int $maxHeapPercentage = null, |
| 62 | 62 | protected bool $injective = false, |
| 63 | 63 | protected int $firstCacheTimeoutMs = 0 |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function __construct( |
| 19 | 19 | protected string $kafkaTopic, |
| 20 | - protected string|array $servers, |
|
| 20 | + protected string | array $servers, |
|
| 21 | 21 | protected array $kafkaProperties = [], |
| 22 | 22 | protected int $connectTimeout = 0, |
| 23 | 23 | protected bool $isOneToOne = false |
@@ -21,9 +21,9 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | protected int $firstCacheTimeoutMs = 0; |
| 23 | 23 | |
| 24 | - protected int|string|null $pollPeriod = null; |
|
| 24 | + protected int | string | null $pollPeriod = null; |
|
| 25 | 25 | |
| 26 | - protected int|null $maxHeapPercentage = null; |
|
| 26 | + protected int | null $maxHeapPercentage = null; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * @var class-string<\Level23\Druid\Lookups\LookupInterface>|null |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | * |
| 276 | 276 | * @return $this |
| 277 | 277 | */ |
| 278 | - public function pollPeriod(int|string $period): self |
|
| 278 | + public function pollPeriod(int | string $period): self |
|
| 279 | 279 | { |
| 280 | 280 | $this->pollPeriod = $period; |
| 281 | 281 | |
@@ -369,7 +369,7 @@ discard block |
||
| 369 | 369 | */ |
| 370 | 370 | public function kafka( |
| 371 | 371 | string $kafkaTopic, |
| 372 | - string|array $servers, |
|
| 372 | + string | array $servers, |
|
| 373 | 373 | array $kafkaProperties = [], |
| 374 | 374 | int $connectTimeout = 0 |
| 375 | 375 | ): LookupBuilder { |
@@ -409,8 +409,8 @@ discard block |
||
| 409 | 409 | */ |
| 410 | 410 | public function jdbc( |
| 411 | 411 | string $connectUri, |
| 412 | - string|null $username, |
|
| 413 | - string|null $password, |
|
| 412 | + string | null $username, |
|
| 413 | + string | null $password, |
|
| 414 | 414 | string $table, |
| 415 | 415 | string $keyColumn, |
| 416 | 416 | string $valueColumn, |