Conditions | 4 |
Paths | 8 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | 37 | public function __toString(): string |
|
32 | { |
||
33 | 37 | $expr = is_string($this->expr) ? $this->expr : (string)$this->expr; |
|
34 | |||
35 | 37 | if ($this->expr instanceof Select) { |
|
36 | 4 | $expr = '(' . str_replace(PHP_EOL, ' ', $expr) . ')'; |
|
37 | } |
||
38 | |||
39 | 37 | if ($this->alias === null) { |
|
40 | 32 | return $expr; |
|
41 | } |
||
42 | |||
43 | 10 | return sprintf('%s AS %s', $expr, $this->alias); |
|
44 | } |
||
58 |