EnvironmentFunction   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 1
dl 0
loc 12
ccs 6
cts 6
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 9 3
1
<?php
2
namespace Desmond\functions\special;
3
use Desmond\functions\DesmondSpecialFunction;
4
5
class EnvironmentFunction extends DesmondSpecialFunction
6
{
7 280
    public function run(array $args)
8
    {
9 280
        foreach ($args as $formIndex => $atom) {
10 233
            $args[$formIndex] = $this->eval->getReturn($atom);
11
        }
12 280
        $actualFunction = $this->currentEnv->get($this->function);
13 280
        $object = new $actualFunction;
14 280
        return method_exists($object, 'run') ? $object->run($args) : $object;
15
    }
16
}
17