DoBlock::run()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 8
cts 8
cp 1
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 8
nc 3
nop 1
crap 3
1
<?php
2
namespace Desmond\functions\special;
3
use Desmond\functions\DesmondSpecialFunction;
4
use Desmond\data_types\NilType;
5
6
class DoBlock extends DesmondSpecialFunction
7
{
8 45
    public function run(array $args)
9
    {
10 45
        if (empty($args)) {
11 1
            return new NilType();
12
        }
13 44
        $last = end($args);
14 44
        array_pop($args);
15 44
        foreach($args as $arg) {
16 40
            $this->eval->getReturn($arg);
17
        }
18 44
        return $this->eval->getReturn($last);
19
    }
20
}
21