| Conditions | 4 |
| Paths | 6 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function makeArray(array $input, $type = 'filter', $onlyShort = false) |
||
| 10 | { |
||
| 11 | if($onlyShort){ |
||
| 12 | $this->shortFunctions = true; |
||
| 13 | } |
||
| 14 | $output = []; |
||
| 15 | $class = '\\Twig_Simple'.ucfirst($type); |
||
| 16 | |||
| 17 | foreach ($input as $call => $function) { |
||
| 18 | $output[] = new $class('sludio_'.$call, [ |
||
| 19 | $this, |
||
| 20 | $function, |
||
| 21 | ]); |
||
| 22 | if ($this->shortFunctions) { |
||
| 23 | $output[] = new $class($call, [ |
||
| 24 | $this, |
||
| 25 | $function, |
||
| 26 | ]); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | return $output; |
||
| 31 | } |
||
| 32 | } |