@@ -17,7 +17,7 @@ |
||
| 17 | 17 | * |
| 18 | 18 | * @return $this |
| 19 | 19 | */ |
| 20 | - public function segmentGranularity(string|Granularity $segmentGranularity): self |
|
| 20 | + public function segmentGranularity(string | Granularity $segmentGranularity): self |
|
| 21 | 21 | { |
| 22 | 22 | $this->segmentGranularity = is_string($segmentGranularity) ? Granularity::from(strtolower($segmentGranularity)) : $segmentGranularity; |
| 23 | 23 | |
@@ -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 $stop = null): self |
|
| 54 | + public function interval(DateTimeInterface | int | string $start, DateTimeInterface | int | string $stop = null): self |
|
| 55 | 55 | { |
| 56 | 56 | $this->interval = new Interval($start, $stop); |
| 57 | 57 | |
@@ -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 $stop = null): self |
|
| 53 | + public function interval(DateTimeInterface | int | string $start, DateTimeInterface | int | string $stop = null): self |
|
| 54 | 54 | { |
| 55 | 55 | $this->intervals[] = new Interval($start, $stop); |
| 56 | 56 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | * @param string $outputName When not given, we will use the same name as the metric. |
| 15 | 15 | * @param string|DataType $type The type of field. This can either be "long", "float", "double" or "string" |
| 16 | 16 | */ |
| 17 | - public function __construct(string $metricName, string $outputName = '', string|DataType $type = DataType::LONG) |
|
| 17 | + public function __construct(string $metricName, string $outputName = '', string | DataType $type = DataType::LONG) |
|
| 18 | 18 | { |
| 19 | 19 | $this->type = is_string($type) ? DataType::from(strtolower($type)) : $type; |
| 20 | 20 | $this->metricName = $metricName; |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | * @param string|DataType $type The type of field. This can either be "long", "float" or |
| 23 | 23 | * "double" |
| 24 | 24 | */ |
| 25 | - public function __construct(string $metricName, string $outputName = '', string|DataType $type = DataType::LONG) |
|
| 25 | + public function __construct(string $metricName, string $outputName = '', string | DataType $type = DataType::LONG) |
|
| 26 | 26 | { |
| 27 | 27 | if (is_string($type)) { |
| 28 | 28 | $type = DataType::from(strtolower($type)); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | public function __construct( |
| 24 | 24 | string $metricName, |
| 25 | 25 | string $outputName = '', |
| 26 | - string|DataType $type = DataType::LONG, |
|
| 26 | + string | DataType $type = DataType::LONG, |
|
| 27 | 27 | int $maxStringBytes = null |
| 28 | 28 | ) { |
| 29 | 29 | if (is_string($type)) { |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | * @param string|DataType $type The type of field. This can either be "long", "float", "double" or "string" |
| 16 | 16 | * |
| 17 | 17 | */ |
| 18 | - public function __construct(string $metricName, string $outputName = '', string|DataType $type = DataType::LONG) |
|
| 18 | + public function __construct(string $metricName, string $outputName = '', string | DataType $type = DataType::LONG) |
|
| 19 | 19 | { |
| 20 | 20 | $this->type = is_string($type) ? DataType::from(strtolower($type)) : $type; |
| 21 | 21 | $this->metricName = $metricName; |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @return self |
| 31 | 31 | */ |
| 32 | - public function from(DataSourceInterface|string $dataSource): self |
|
| 32 | + public function from(DataSourceInterface | string $dataSource): self |
|
| 33 | 33 | { |
| 34 | 34 | return $this->dataSource($dataSource); |
| 35 | 35 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @return self |
| 43 | 43 | */ |
| 44 | - public function dataSource(DataSourceInterface|string $dataSource): self |
|
| 44 | + public function dataSource(DataSourceInterface | string $dataSource): self |
|
| 45 | 45 | { |
| 46 | 46 | if (is_string($dataSource)) { |
| 47 | 47 | $this->dataSource = new TableDataSource($dataSource); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * @return self |
| 62 | 62 | */ |
| 63 | - public function join(DataSourceInterface|Closure|string $dataSourceOrClosure, string $as, string $condition, string|JoinType $joinType = JoinType::INNER): self |
|
| 63 | + public function join(DataSourceInterface | Closure | string $dataSourceOrClosure, string $as, string $condition, string | JoinType $joinType = JoinType::INNER): self |
|
| 64 | 64 | { |
| 65 | 65 | if ($this->dataSource instanceof TableDataSource && $this->dataSource->dataSourceName == '') { |
| 66 | 66 | throw new InvalidArgumentException('You first have to define your "from" dataSource before you can join!'); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | string $lookupName, |
| 99 | 99 | string $as, |
| 100 | 100 | string $condition, |
| 101 | - string|JoinType $joinType = JoinType::INNER |
|
| 101 | + string | JoinType $joinType = JoinType::INNER |
|
| 102 | 102 | ): self { |
| 103 | 103 | $lookupDataSource = new LookupDataSource($lookupName); |
| 104 | 104 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * |
| 113 | 113 | * @return self |
| 114 | 114 | */ |
| 115 | - public function leftJoin(DataSourceInterface|Closure|string $dataSourceOrClosure, string $as, string $condition): self |
|
| 115 | + public function leftJoin(DataSourceInterface | Closure | string $dataSourceOrClosure, string $as, string $condition): self |
|
| 116 | 116 | { |
| 117 | 117 | return $this->join($dataSourceOrClosure, $as, $condition, JoinType::LEFT); |
| 118 | 118 | } |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | * |
| 125 | 125 | * @return self |
| 126 | 126 | */ |
| 127 | - public function innerJoin(DataSourceInterface|Closure|string $dataSourceOrClosure, string $as, string $condition): self |
|
| 127 | + public function innerJoin(DataSourceInterface | Closure | string $dataSourceOrClosure, string $as, string $condition): self |
|
| 128 | 128 | { |
| 129 | 129 | return $this->join($dataSourceOrClosure, $as, $condition); |
| 130 | 130 | } |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @return $this |
| 161 | 161 | * @see https://druid.apache.org/docs/latest/querying/datasource.html#union |
| 162 | 162 | */ |
| 163 | - public function union(array|string $dataSources, bool $append = true): self |
|
| 163 | + public function union(array | string $dataSources, bool $append = true): self |
|
| 164 | 164 | { |
| 165 | 165 | $dataSources = (array)$dataSources; |
| 166 | 166 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | * @return DataSourceInterface |
| 184 | 184 | * @throws InvalidArgumentException |
| 185 | 185 | */ |
| 186 | - protected function getDataSource(DataSourceInterface|Closure|string $dataSourceOrClosure): DataSourceInterface |
|
| 186 | + protected function getDataSource(DataSourceInterface | Closure | string $dataSourceOrClosure): DataSourceInterface |
|
| 187 | 187 | { |
| 188 | 188 | if ($dataSourceOrClosure instanceof DataSourceInterface) { |
| 189 | 189 | return $dataSourceOrClosure; |
@@ -84,11 +84,11 @@ discard block |
||
| 84 | 84 | * @throws \Exception |
| 85 | 85 | */ |
| 86 | 86 | public function timeBoundary( |
| 87 | - string|DataSourceInterface $dataSource, |
|
| 88 | - null|string|TimeBound $bound = TimeBound::BOTH, |
|
| 87 | + string | DataSourceInterface $dataSource, |
|
| 88 | + null | string | TimeBound $bound = TimeBound::BOTH, |
|
| 89 | 89 | \Closure $filterBuilder = null, |
| 90 | 90 | ContextInterface $context = null |
| 91 | - ): DateTime|array { |
|
| 91 | + ): DateTime | array { |
|
| 92 | 92 | |
| 93 | 93 | $query = [ |
| 94 | 94 | 'queryType' => 'timeBoundary', |
@@ -300,8 +300,8 @@ discard block |
||
| 300 | 300 | */ |
| 301 | 301 | protected function getColumnsForInterval( |
| 302 | 302 | string $dataSource, |
| 303 | - DateTimeInterface|int|string $start, |
|
| 304 | - DateTimeInterface|int|string $stop = null |
|
| 303 | + DateTimeInterface | int | string $start, |
|
| 304 | + DateTimeInterface | int | string $stop = null |
|
| 305 | 305 | ): array { |
| 306 | 306 | $response = $this->client->query($dataSource) |
| 307 | 307 | ->interval($start, $stop) |
@@ -342,8 +342,8 @@ discard block |
||
| 342 | 342 | */ |
| 343 | 343 | public function rowCount( |
| 344 | 344 | string $dataSource, |
| 345 | - DateTimeInterface|int|string $start, |
|
| 346 | - DateTimeInterface|int|string $stop = null |
|
| 345 | + DateTimeInterface | int | string $start, |
|
| 346 | + DateTimeInterface | int | string $stop = null |
|
| 347 | 347 | ): int { |
| 348 | 348 | $response = $this->client->query($dataSource) |
| 349 | 349 | ->interval($start, $stop) |