Conditions | 4 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function makeArray(array $input, $type = 'filter') |
||
10 | { |
||
11 | $output = []; |
||
12 | $class = '\\Twig_Simple'.ucfirst($type); |
||
13 | $this->makeInput($input, $input); |
||
14 | |||
15 | foreach ($input as $call => $function) { |
||
16 | if (\is_array($function)) { |
||
17 | $options = isset($function[2]) ? $function[2] : []; |
||
18 | unset($function[2]); |
||
19 | $output[] = new $class($call, $function, $options); |
||
20 | } else { |
||
21 | $output[] = new $class($call, [ |
||
22 | $this, |
||
23 | $function, |
||
24 | ]); |
||
25 | } |
||
26 | } |
||
27 | |||
28 | return $output; |
||
29 | } |
||
42 |