Conditions | 5 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 5 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
28 | 2 | public function compile(QueryBuilder $queryBuilder): string |
|
29 | { |
||
30 | $this->edgeCollections = array_map(function ($edgeCollection) use ($queryBuilder) { |
||
31 | 2 | if (!$queryBuilder->grammar->isGraphDirection($edgeCollection)) { |
|
32 | 2 | return $queryBuilder->normalizeArgument($edgeCollection, ['Collection', 'Query', 'Bind']); |
|
33 | } |
||
34 | 1 | return $edgeCollection; |
|
35 | 2 | }, $this->edgeCollections); |
|
36 | |||
37 | 2 | $output = ''; |
|
38 | 2 | foreach ($this->edgeCollections as $value) { |
|
39 | 2 | if ($value instanceof ExpressionInterface) { |
|
40 | 2 | $output .= $value->compile($queryBuilder) . ', '; |
|
41 | } |
||
42 | 2 | if (is_string($value)) { |
|
43 | 1 | $output .= $value . ' '; |
|
44 | } |
||
45 | } |
||
46 | |||
47 | 2 | return rtrim($output, ', '); |
|
48 | } |
||
50 |