| Conditions | 4 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 15 |
| 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 = []; |
||
| 18 | if (isset($function[2])) { |
||
| 19 | $options[] = $function[2]; |
||
| 20 | unset($function[2]); |
||
| 21 | } |
||
| 22 | $output[] = new $class($call, $function, $options); |
||
| 23 | } else { |
||
| 24 | $output[] = new $class($call, [ |
||
| 25 | $this, |
||
| 26 | $function, |
||
| 27 | ]); |
||
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | return $output; |
||
| 32 | } |
||
| 45 |