Passed
Pull Request — master (#46)
by Teye
16:01
created
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.
src/Concerns/HasFilter.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
      * @return $this
65 65
      */
66 66
     public function where(
67
-        Closure|string|FilterInterface $filterOrDimensionOrClosure,
68
-        int|string $operator = null,
69
-        array|int|string|float|bool $value = null,
67
+        Closure | string | FilterInterface $filterOrDimensionOrClosure,
68
+        int | string $operator = null,
69
+        array | int | string | float | bool $value = null,
70 70
         Closure $extraction = null,
71 71
         string $boolean = 'and'
72 72
     ): self {
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
      * @see \Level23\Druid\Concerns\HasFilter::where()
219 219
      */
220 220
     public function orWhere(
221
-        string|FilterInterface $filterOrDimension,
221
+        string | FilterInterface $filterOrDimension,
222 222
         string $operator = null,
223
-        array|int|string $value = null,
223
+        array | int | string $value = null,
224 224
         Closure $extraction = null
225 225
     ): self {
226 226
         return $this->where($filterOrDimension, $operator, $value, $extraction, 'or');
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
      *
326 326
      * @return $this
327 327
      */
328
-    public function whereColumn(Closure|string $dimensionA, Closure|string $dimensionB, string $boolean = 'and'): self
328
+    public function whereColumn(Closure | string $dimensionA, Closure | string $dimensionB, string $boolean = 'and'): self
329 329
     {
330 330
         $filter = new ColumnComparisonFilter(
331 331
             $this->columnCompareDimension($dimensionA),
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
      *
357 357
      * @return $this
358 358
      */
359
-    public function orWhereColumn(Closure|string $dimensionA, Closure|string $dimensionB): self
359
+    public function orWhereColumn(Closure | string $dimensionA, Closure | string $dimensionB): self
360 360
     {
361 361
         return $this->whereColumn($dimensionA, $dimensionB, 'or');
362 362
     }
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
      *
383 383
      * @return $this
384 384
      */
385
-    public function orWhereNotColumn(Closure|string $dimensionA, Closure|string $dimensionB): self
385
+    public function orWhereNotColumn(Closure | string $dimensionA, Closure | string $dimensionB): self
386 386
     {
387 387
         return $this->whereNot(function (FilterBuilder $builder) use ($dimensionA, $dimensionB) {
388 388
             $builder->whereColumn($dimensionA, $dimensionB);
@@ -418,10 +418,10 @@  discard block
 block discarded – undo
418 418
      */
419 419
     public function whereBetween(
420 420
         string $dimension,
421
-        int|string $minValue,
422
-        int|string $maxValue,
421
+        int | string $minValue,
422
+        int | string $maxValue,
423 423
         Closure $extraction = null,
424
-        string|SortingOrder $ordering = null,
424
+        string | SortingOrder $ordering = null,
425 425
         string $boolean = 'and'
426 426
     ): self {
427 427
         $filter = new BetweenFilter($dimension, $minValue, $maxValue, $ordering, $this->getExtraction($extraction));
@@ -456,10 +456,10 @@  discard block
 block discarded – undo
456 456
      */
457 457
     public function orWhereBetween(
458 458
         string $dimension,
459
-        int|string $minValue,
460
-        int|string $maxValue,
459
+        int | string $minValue,
460
+        int | string $maxValue,
461 461
         Closure $extraction = null,
462
-        string|SortingOrder $ordering = null
462
+        string | SortingOrder $ordering = null
463 463
     ): self {
464 464
         return $this->whereBetween($dimension, $minValue, $maxValue, $extraction, $ordering, 'or');
465 465
     }
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
      * @return \Level23\Druid\Dimensions\DimensionInterface
765 765
      * @throws InvalidArgumentException
766 766
      */
767
-    protected function columnCompareDimension(Closure|string $dimension): DimensionInterface
767
+    protected function columnCompareDimension(Closure | string $dimension): DimensionInterface
768 768
     {
769 769
         if ($dimension instanceof Closure) {
770 770
             $builder = new DimensionBuilder();
Please login to merge, or discard this patch.
src/Concerns/HasInterval.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.