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