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