| Conditions | 3 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | 1 | public function compile(QueryBuilder $queryBuilder): string |
|
| 21 | { |
||
| 22 | 1 | $this->groupsVariable = $queryBuilder->normalizeArgument($this->groupsVariable, 'Variable'); |
|
|
|
|||
| 23 | 1 | $queryBuilder->registerVariable($this->groupsVariable); |
|
| 24 | |||
| 25 | 1 | if (isset($this->projectionExpression)) { |
|
| 26 | 1 | $this->projectionExpression = $queryBuilder->normalizeArgument( |
|
| 27 | 1 | $this->projectionExpression, |
|
| 28 | 1 | ['Reference', 'Object', 'Function', 'Query', 'Bind'] |
|
| 29 | ); |
||
| 30 | } |
||
| 31 | |||
| 32 | 1 | $output = 'INTO ' . $this->groupsVariable->compile($queryBuilder); |
|
| 33 | 1 | if (isset($this->projectionExpression)) { |
|
| 34 | 1 | $output .= ' = ' . $this->projectionExpression->compile($queryBuilder); |
|
| 35 | } |
||
| 36 | |||
| 37 | 1 | return $output; |
|
| 38 | } |
||
| 40 |