Conditions | 3 |
Paths | 4 |
Total Lines | 23 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
11 | 7 | public function run(array $args) |
|
12 | { |
||
13 | 7 | $name = $args[0]->value(); |
|
14 | 7 | if (!NS::exists($name)) { |
|
15 | 4 | $newEnv = $this->currentEnv->makeChild(); |
|
16 | 4 | $this->currentEnv = $this->currentEnv->values[$newEnv]; |
|
17 | 4 | NS::create($name, $this->currentEnv); |
|
18 | } else { |
||
19 | 5 | $this->currentEnv = NS::get($name); |
|
20 | } |
||
21 | |||
22 | |||
23 | 7 | $last = end($args); |
|
24 | 7 | array_pop($args); |
|
25 | 7 | array_shift($args); |
|
26 | 7 | foreach($args as $arg) { |
|
27 | 1 | $this->eval->getReturn($arg); |
|
28 | } |
||
29 | 7 | $return = $this->eval->getReturn($last); |
|
30 | |||
31 | 7 | $this->currentEnv = $this->currentEnv->getParent(); |
|
32 | 7 | return $return; |
|
33 | } |
||
34 | } |
||
35 |