| Conditions | 7 |
| Paths | 7 |
| Total Lines | 23 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function __invoke($exp, Env $env) |
||
| 19 | { |
||
| 20 | if ($exp instanceof Symbol) { |
||
| 21 | return $env->$exp; |
||
| 22 | } |
||
| 23 | |||
| 24 | if (\is_numeric($exp) || \is_string($exp)) { |
||
| 25 | return $exp; |
||
| 26 | } |
||
| 27 | |||
| 28 | foreach ($this->specialForms as $specialForm) { |
||
| 29 | if ($specialForm->handles($exp)) { |
||
| 30 | return $specialForm->evaluate($exp, $env, $this); |
||
| 31 | } |
||
| 32 | } |
||
| 33 | |||
| 34 | $call = $this($exp[0], $env); |
||
| 35 | $args = []; |
||
| 36 | foreach (\array_slice($exp, 1) as $arg) { |
||
| 37 | $args[] = $this($arg, $env); |
||
| 38 | } |
||
| 39 | |||
| 40 | return $call(...$args); |
||
| 41 | } |
||
| 42 | } |