Conditions | 5 |
Paths | 5 |
Total Lines | 23 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 5 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | 3 | public function compile(QueryBuilder $queryBuilder): string |
|
35 | { |
||
36 | /** @var array<string|Expression> $edgeCollections */ |
||
37 | 3 | $edgeCollections = array_map(function ($edgeCollection) use ($queryBuilder) { |
|
38 | 3 | if (!$queryBuilder->grammar->isGraphDirection($edgeCollection)) { |
|
39 | 3 | return $queryBuilder->normalizeArgument($edgeCollection, ['Collection', 'Query', 'Bind']); |
|
40 | } |
||
41 | |||
42 | 1 | return $edgeCollection; |
|
43 | 3 | }, $this->edgeCollections); |
|
44 | |||
45 | 3 | $output = ''; |
|
46 | 3 | foreach ($edgeCollections as $value) { |
|
47 | 3 | if ($value instanceof ExpressionInterface) { |
|
48 | 3 | $output .= $value->compile($queryBuilder) . ', '; |
|
49 | } |
||
50 | |||
51 | 3 | if (is_string($value)) { |
|
52 | 1 | $output .= $value . ' '; |
|
53 | } |
||
54 | } |
||
55 | |||
56 | 3 | return rtrim($output, ', '); |
|
57 | } |
||
59 |