Passed
Pull Request — master (#46)
by Teye
16:01
created
src/Concerns/HasTuningConfig.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
      *
20 20
      * @return $this
21 21
      */
22
-    public function tuningConfig(array|TuningConfig $tuningConfig): self
22
+    public function tuningConfig(array | TuningConfig $tuningConfig): self
23 23
     {
24 24
         if (!$tuningConfig instanceof TuningConfig) {
25 25
             $tuningConfig = new TuningConfig($tuningConfig);
Please login to merge, or discard this patch.
src/Concerns/HasAggregations.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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(
Please login to merge, or discard this patch.
src/Concerns/HasDimensions.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
      * @return self
51 51
      */
52 52
     public function select(
53
-        array|ArrayObject|string|DimensionInterface $dimension,
53
+        array | ArrayObject | string | DimensionInterface $dimension,
54 54
         string $as = '',
55 55
         Closure $extraction = null,
56
-        string|DataType $outputType = DataType::STRING
56
+        string | DataType $outputType = DataType::STRING
57 57
     ): self {
58 58
         if (is_string($dimension)) {
59 59
             if (!empty($extraction)) {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         string $lookupFunction,
97 97
         string $dimension,
98 98
         string $as = '',
99
-        bool|string $keepMissingValue = false
99
+        bool | string $keepMissingValue = false
100 100
     ): self {
101 101
         $this->addDimension(new LookupDimension(
102 102
             $dimension,
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         array $map,
131 131
         string $dimension,
132 132
         string $as = '',
133
-        bool|string $keepMissingValue = false,
133
+        bool | string $keepMissingValue = false,
134 134
         bool $isOneToOne = false
135 135
     ): self {
136 136
         $this->addDimension(new LookupDimension(
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         string $dimension,
163 163
         array $values,
164 164
         string $as = '',
165
-        string|DataType $outputType = DataType::STRING,
165
+        string | DataType $outputType = DataType::STRING,
166 166
         bool $isWhitelist = true
167 167
     ): self {
168 168
         $this->addDimension(new ListFilteredDimension(
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         string $dimension,
197 197
         string $regex,
198 198
         string $as = '',
199
-        string|DataType $outputType = DataType::STRING
199
+        string | DataType $outputType = DataType::STRING
200 200
     ): self {
201 201
         $this->addDimension(new RegexFilteredDimension(
202 202
             new Dimension(
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         string $dimension,
228 228
         string $prefix,
229 229
         string $as = '',
230
-        string|DataType $outputType = DataType::STRING
230
+        string | DataType $outputType = DataType::STRING
231 231
     ): self {
232 232
         $this->addDimension(new PrefixFilteredDimension(
233 233
             new Dimension(
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
      *
247 247
      * @param ArrayObject<int|string,string>|string|DimensionInterface|array<int,string> $dimension
248 248
      */
249
-    protected function addDimension(array|ArrayObject|string|DimensionInterface $dimension): void
249
+    protected function addDimension(array | ArrayObject | string | DimensionInterface $dimension): void
250 250
     {
251 251
         if ($dimension instanceof DimensionInterface) {
252 252
             $this->dimensions[] = $dimension;
Please login to merge, or discard this patch.
src/Concerns/HasDataSource.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 (is_string($dataSourceOrClosure)) {
189 189
             return new TableDataSource($dataSourceOrClosure);
Please login to merge, or discard this patch.
src/Concerns/HasLimit.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function orderBy(
68 68
         string $dimensionOrMetric,
69
-        string|OrderByDirection $direction = OrderByDirection::ASC,
70
-        string|SortingOrder $sortingOrder = SortingOrder::LEXICOGRAPHIC
69
+        string | OrderByDirection $direction = OrderByDirection::ASC,
70
+        string | SortingOrder $sortingOrder = SortingOrder::LEXICOGRAPHIC
71 71
     ): self {
72 72
         $order = new OrderBy($dimensionOrMetric, $direction, $sortingOrder);
73 73
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      *
89 89
      * @return $this
90 90
      */
91
-    public function orderByDirection(string|OrderByDirection $direction = OrderByDirection::DESC): self
91
+    public function orderByDirection(string | OrderByDirection $direction = OrderByDirection::DESC): self
92 92
     {
93 93
         $this->direction = is_string($direction) ? OrderByDirection::make($direction) : $direction;
94 94
 
Please login to merge, or discard this patch.
src/Concerns/HasPostAggregations.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
      *
117 117
      * @return $this
118 118
      */
119
-    public function quantile(string $as, Closure|string $fieldOrClosure, float $fraction): self
119
+    public function quantile(string $as, Closure | string $fieldOrClosure, float $fraction): self
120 120
     {
121 121
         $fields = $this->buildFields([$fieldOrClosure]);
122 122
         if ($fields->count() != 1 || !$fields[0]) {
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
      *
152 152
      * @return $this
153 153
      */
154
-    public function quantiles(string $as, Closure|string $fieldOrClosure, array $fractions): self
154
+    public function quantiles(string $as, Closure | string $fieldOrClosure, array $fractions): self
155 155
     {
156 156
         $fields = $this->buildFields([$fieldOrClosure]);
157 157
         if ($fields->count() != 1 || !$fields[0]) {
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      *
191 191
      * @return $this
192 192
      */
193
-    public function histogram(string $as, Closure|string $fieldOrClosure, ?array $splitPoints = null, ?int $numBins = null): self
193
+    public function histogram(string $as, Closure | string $fieldOrClosure, ?array $splitPoints = null, ?int $numBins = null): self
194 194
     {
195 195
         $fields = $this->buildFields([$fieldOrClosure]);
196 196
         if ($fields->count() != 1 || !$fields[0]) {
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
      *
227 227
      * @return $this
228 228
      */
229
-    public function rank(string $as, Closure|string $fieldOrClosure, float|int $value): self
229
+    public function rank(string $as, Closure | string $fieldOrClosure, float | int $value): self
230 230
     {
231 231
         $fields = $this->buildFields([$fieldOrClosure]);
232 232
         if ($fields->count() != 1 || !$fields[0]) {
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
      *
264 264
      * @return $this
265 265
      */
266
-    public function cdf(string $as, Closure|string $fieldOrClosure, array $splitPoints): self
266
+    public function cdf(string $as, Closure | string $fieldOrClosure, array $splitPoints): self
267 267
     {
268 268
         $fields = $this->buildFields([$fieldOrClosure]);
269 269
         if ($fields->count() != 1 || !$fields[0]) {
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      *
297 297
      * @return $this
298 298
      */
299
-    public function sketchSummary(string $as, Closure|string $fieldOrClosure): self
299
+    public function sketchSummary(string $as, Closure | string $fieldOrClosure): self
300 300
     {
301 301
         $fields = $this->buildFields([$fieldOrClosure]);
302 302
         if ($fields->count() != 1 || !$fields[0]) {
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
      *
447 447
      * @return $this
448 448
      */
449
-    public function constant(float|int $numericValue, string $as): self
449
+    public function constant(float | int $numericValue, string $as): self
450 450
     {
451 451
         $this->postAggregations[] = new ConstantPostAggregator($as, $numericValue);
452 452
 
Please login to merge, or discard this patch.
src/Concerns/HasQueryGranularity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
      *
18 18
      * @return $this
19 19
      */
20
-    public function queryGranularity(string|Granularity $queryGranularity): self
20
+    public function queryGranularity(string | Granularity $queryGranularity): self
21 21
     {
22 22
         $this->queryGranularity = is_string($queryGranularity) ? Granularity::from(strtolower($queryGranularity)) : $queryGranularity;
23 23
 
Please login to merge, or discard this patch.
src/Concerns/HasHaving.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
      * @return $this
36 36
      */
37 37
     public function having(
38
-        Closure|string|HavingFilterInterface|FilterInterface $havingOrMetricOrClosure,
39
-        float|string $operator = null,
40
-        float|string|bool $value = null,
38
+        Closure | string | HavingFilterInterface | FilterInterface $havingOrMetricOrClosure,
39
+        float | string $operator = null,
40
+        float | string | bool $value = null,
41 41
         string $boolean = 'and'
42 42
     ): self {
43 43
         $having = null;
@@ -109,9 +109,9 @@  discard block
 block discarded – undo
109 109
      * @return $this
110 110
      */
111 111
     public function orHaving(
112
-        Closure|HavingFilterInterface|string $havingOrMetricOrClosure,
113
-        float|string $operator = null,
114
-        float|string $value = null
112
+        Closure | HavingFilterInterface | string $havingOrMetricOrClosure,
113
+        float | string $operator = null,
114
+        float | string $value = null
115 115
     ): self {
116 116
         return $this->having($havingOrMetricOrClosure, $operator, $value, 'or');
117 117
     }
Please login to merge, or discard this patch.
src/Concerns/HasSegmentGranularity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.