Total Complexity | 4 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Coverage | 55.56% |
Changes | 0 |
1 | <?php |
||
18 | final class UnionKeyword implements Component |
||
19 | { |
||
20 | /** |
||
21 | * Parses the tokens contained in the given list in the context of the given parser. |
||
22 | * |
||
23 | * @param Parser $parser the parser that serves as context |
||
24 | * @param TokensList $list the list of tokens that are being parsed |
||
25 | * @param array<string, mixed> $options parameters for parsing |
||
26 | * |
||
27 | * @return mixed |
||
28 | * |
||
29 | * @throws RuntimeException not implemented yet. |
||
30 | */ |
||
31 | public static function parse(Parser $parser, TokensList $list, array $options = []) |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param array<UnionKeyword[]> $component the component to be built |
||
38 | * @param array<string, mixed> $options parameters for building |
||
39 | */ |
||
40 | 8 | public static function build($component, array $options = []): string |
|
41 | { |
||
42 | 8 | $tmp = []; |
|
43 | 8 | foreach ($component as $componentPart) { |
|
44 | 8 | $tmp[] = $componentPart[0] . ' ' . $componentPart[1]; |
|
45 | } |
||
46 | |||
47 | 8 | return implode(' ', $tmp); |
|
48 | } |
||
49 | |||
50 | public function __toString(): string |
||
53 | } |
||
54 | } |
||
55 |