|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace LaravelFreelancerNL\FluentAQL\Clauses; |
|
6
|
|
|
|
|
7
|
|
|
use LaravelFreelancerNL\FluentAQL\Expressions\Expression; |
|
8
|
|
|
use LaravelFreelancerNL\FluentAQL\QueryBuilder; |
|
9
|
|
|
use phpDocumentor\Reflection\Types\ArrayKey; |
|
10
|
|
|
|
|
11
|
|
|
class WindowClause extends Clause |
|
12
|
|
|
{ |
|
13
|
|
|
/** |
|
14
|
|
|
* @var array<ArrayKey, string>|object $offsets |
|
15
|
|
|
*/ |
|
16
|
|
|
protected array|object $offsets; |
|
17
|
|
|
|
|
18
|
|
|
protected null|string|QueryBuilder|Expression $rangeValue; |
|
|
|
|
|
|
19
|
|
|
|
|
20
|
|
|
protected string|null $expression; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* CollectClause constructor. |
|
24
|
|
|
* @param array<ArrayKey, string>|object $offsets |
|
25
|
|
|
*/ |
|
26
|
2 |
|
public function __construct( |
|
27
|
|
|
array|object $offsets, |
|
28
|
|
|
null|string|QueryBuilder|Expression $rangeValue = null |
|
29
|
|
|
) { |
|
30
|
2 |
|
$this->offsets = $offsets; |
|
31
|
2 |
|
$this->rangeValue = $rangeValue; |
|
32
|
2 |
|
} |
|
33
|
|
|
|
|
34
|
2 |
|
public function compile(QueryBuilder $queryBuilder): string |
|
35
|
|
|
{ |
|
36
|
2 |
|
$this->offsets = $queryBuilder->normalizeArgument( |
|
37
|
2 |
|
$this->offsets, |
|
38
|
2 |
|
['List', 'Reference', 'Function', 'Query', 'Bind'], |
|
39
|
|
|
); |
|
40
|
|
|
|
|
41
|
2 |
|
if (isset($this->rangeValue)) { |
|
42
|
1 |
|
$this->rangeValue = $queryBuilder->normalizeArgument( |
|
43
|
1 |
|
$this->rangeValue, |
|
44
|
1 |
|
['Reference', 'Function', 'Query', 'Bind'], |
|
45
|
|
|
); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
2 |
|
$output = 'WINDOW'; |
|
49
|
2 |
|
if (isset($this->rangeValue)) { |
|
50
|
|
|
/** @phpstan-ignore-next-line */ |
|
51
|
1 |
|
$output .= ' ' . $this->rangeValue->compile($queryBuilder); |
|
|
|
|
|
|
52
|
1 |
|
$output .= ' WITH'; |
|
53
|
|
|
} |
|
54
|
2 |
|
$output .= ' ' . $this->offsets->compile($queryBuilder); |
|
55
|
|
|
|
|
56
|
2 |
|
return $output; |
|
57
|
|
|
} |
|
58
|
|
|
} |
|
59
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths