Conditions | 4 |
Paths | 5 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | public static function build($component, array $options = []) |
||
40 | { |
||
41 | if (! $component instanceof WithKeyword) { |
||
|
|||
42 | throw new RuntimeException('Can not build a component that is not a WithKeyword'); |
||
43 | } |
||
44 | |||
45 | $str = $component->name; |
||
46 | |||
47 | if ($component->columns) { |
||
48 | $str .= ArrayObj::build($component->columns); |
||
49 | } |
||
50 | |||
51 | $str .= ' AS ('; |
||
52 | |||
53 | foreach ($component->statement->statements as $statement) { |
||
54 | $str .= $statement->build(); |
||
55 | } |
||
56 | |||
57 | $str .= ')'; |
||
58 | |||
59 | return $str; |
||
60 | } |
||
62 |