@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | protected NullHandling $nullHandling; |
| 19 | 19 | |
| 20 | - public function __construct(string $sprintfExpression, string|NullHandling $nullHandling = NullHandling::NULL_STRING) |
|
| 20 | + public function __construct(string $sprintfExpression, string | NullHandling $nullHandling = NullHandling::NULL_STRING) |
|
| 21 | 21 | { |
| 22 | 22 | $this->sprintfExpression = $sprintfExpression; |
| 23 | 23 | $this->nullHandling = is_string($nullHandling) ? NullHandling::from($nullHandling) : $nullHandling; |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | public function __construct( |
| 51 | 51 | ?string $format = null, |
| 52 | - string|Granularity $granularity = null, |
|
| 52 | + string | Granularity $granularity = null, |
|
| 53 | 53 | ?string $locale = null, |
| 54 | 54 | ?string $timeZone = null, |
| 55 | 55 | ?bool $asMilliseconds = null |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | public function __construct( |
| 28 | 28 | string $regexp, |
| 29 | 29 | int $groupToExtract = 1, |
| 30 | - bool|string $keepMissingValue = false |
|
| 30 | + bool | string $keepMissingValue = false |
|
| 31 | 31 | ) { |
| 32 | 32 | $this->regexp = $regexp; |
| 33 | 33 | $this->groupToExtract = $groupToExtract; |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * whether it is injective. If left unspecified, Druid will |
| 35 | 35 | * use the registered cluster-wide lookup configuration. |
| 36 | 36 | */ |
| 37 | - public function __construct(array $map, bool|string $keepMissingValue = false, bool $optimize = true, bool $injective = null) |
|
| 37 | + public function __construct(array $map, bool | string $keepMissingValue = false, bool $optimize = true, bool $injective = null) |
|
| 38 | 38 | { |
| 39 | 39 | $this->map = $map; |
| 40 | 40 | $this->optimize = $optimize; |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function __construct( |
| 36 | 36 | string $lookupName, |
| 37 | - bool|string $replaceMissingValue = true, |
|
| 37 | + bool | string $replaceMissingValue = true, |
|
| 38 | 38 | bool $optimize = true, |
| 39 | 39 | ?bool $injective = null |
| 40 | 40 | |
@@ -28,13 +28,13 @@ |
||
| 28 | 28 | public function __construct( |
| 29 | 29 | string $dimension, |
| 30 | 30 | string $outputName = null, |
| 31 | - string|DataType $outputType = DataType::STRING, |
|
| 31 | + string | DataType $outputType = DataType::STRING, |
|
| 32 | 32 | ExtractionInterface $extractionFunction = null |
| 33 | 33 | ) { |
| 34 | 34 | $this->dimension = $dimension; |
| 35 | 35 | $this->outputName = $outputName ?: $dimension; |
| 36 | 36 | |
| 37 | - if( empty($outputType)) { |
|
| 37 | + if (empty($outputType)) { |
|
| 38 | 38 | $outputType = DataType::STRING; |
| 39 | 39 | } else { |
| 40 | 40 | $outputType = is_string($outputType) ? DataType::from(strtolower($outputType)) : $outputType; |
@@ -12,12 +12,12 @@ discard block |
||
| 12 | 12 | /** |
| 13 | 13 | * @var string|array<int|string,string> |
| 14 | 14 | */ |
| 15 | - protected string|array $registeredLookupFunctionOrMap; |
|
| 15 | + protected string | array $registeredLookupFunctionOrMap; |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * @var bool|string |
| 19 | 19 | */ |
| 20 | - protected string|bool $keepMissingValue; |
|
| 20 | + protected string | bool $keepMissingValue; |
|
| 21 | 21 | |
| 22 | 22 | protected bool $isOneToOne; |
| 23 | 23 | |
@@ -39,9 +39,9 @@ discard block |
||
| 39 | 39 | */ |
| 40 | 40 | public function __construct( |
| 41 | 41 | string $dimension, |
| 42 | - array|string $registeredLookupFunctionOrMap, |
|
| 42 | + array | string $registeredLookupFunctionOrMap, |
|
| 43 | 43 | string $outputName = '', |
| 44 | - bool|string $keepMissingValue = false, |
|
| 44 | + bool | string $keepMissingValue = false, |
|
| 45 | 45 | bool $isOneToOne = false |
| 46 | 46 | ) { |
| 47 | 47 | $this->dimension = $dimension; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * |
| 93 | 93 | * @return \Level23\Druid\Queries\QueryBuilder |
| 94 | 94 | */ |
| 95 | - public function query(string $dataSource = '', string|Granularity $granularity = Granularity::ALL): QueryBuilder |
|
| 95 | + public function query(string $dataSource = '', string | Granularity $granularity = Granularity::ALL): QueryBuilder |
|
| 96 | 96 | { |
| 97 | 97 | return new QueryBuilder($this, $dataSource, $granularity); |
| 98 | 98 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | /** @var array<string,array<mixed>|int|string> $payload */ |
| 149 | 149 | $payload = $task->toArray(); |
| 150 | 150 | |
| 151 | - $this->log('Executing druid task: '. var_export($payload, true)); |
|
| 151 | + $this->log('Executing druid task: ' . var_export($payload, true)); |
|
| 152 | 152 | |
| 153 | 153 | /** @var string[] $result */ |
| 154 | 154 | $result = $this->executeRawRequest( |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | if (!is_array($row)) { |
| 328 | 328 | throw new InvalidArgumentException('We failed to parse response!'); |
| 329 | 329 | } |
| 330 | - } catch (InvalidArgumentException|JsonException $exception ) { |
|
| 330 | + } catch (InvalidArgumentException | JsonException $exception) { |
|
| 331 | 331 | $this->log('We failed to decode druid response. '); |
| 332 | 332 | $this->log('Status code: ' . $response->getStatusCode()); |
| 333 | 333 | $this->log('Response body: ' . $contents); |
@@ -22,9 +22,9 @@ |
||
| 22 | 22 | * @param PostAggregationCollection $fields |
| 23 | 23 | * @param string|DataType $type |
| 24 | 24 | */ |
| 25 | - public function __construct(string $outputName, PostAggregationCollection $fields, string|DataType $type = DataType::LONG) |
|
| 25 | + public function __construct(string $outputName, PostAggregationCollection $fields, string | DataType $type = DataType::LONG) |
|
| 26 | 26 | { |
| 27 | - $type = is_string($type)? DataType::from(strtolower($type)) : $type; |
|
| 27 | + $type = is_string($type) ? DataType::from(strtolower($type)) : $type; |
|
| 28 | 28 | if (!in_array($type, [DataType::LONG, DataType::DOUBLE])) { |
| 29 | 29 | throw new InvalidArgumentException( |
| 30 | 30 | 'Supported types are "long" and "double". Value given: ' . $type->value |