Conditions | 5 |
Paths | 8 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
7 | public static function inlineMixedInstructions(array $instructions, $operator = null) |
||
8 | { |
||
9 | $elements = []; |
||
10 | |||
11 | foreach ($instructions as $instruction) { |
||
12 | if ($instruction instanceof RuntimeOperator) { |
||
13 | $elements[] = $instruction->format(true); |
||
14 | } else if ($instruction instanceof CompileTimeOperator) { |
||
15 | $elements[] = sprintf('%s', $instruction->format(false)); |
||
16 | } else { |
||
17 | $elements[] = sprintf('%s', $instruction); |
||
18 | } |
||
19 | } |
||
20 | |||
21 | if (null === $operator) { |
||
22 | return join('', $elements); |
||
23 | } else { |
||
24 | return join(' '.$operator.' ', $elements); |
||
25 | } |
||
26 | } |
||
27 | } |
||
28 |