Passed
Push — master ( 310acb...1a0150 )
by Scott
02:48
created

Get::id()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
namespace Desmond\functions\core;
3
use Desmond\functions\DesmondFunction;
4
use Desmond\ArgumentHelper;
5
use Desmond\data_types\AbstractCollection;
6
use Desmond\data_types\NumberType;
7
use Desmond\data_types\StringType;
8
use Desmond\data_types\SymbolType;
9
use Desmond\exceptions\ArgumentException;
10
11
class Get extends DesmondFunction
12
{
13
    use ArgumentHelper;
14
15 187
    public function id()
16
    {
17 187
        return 'get';
18
    }
19
20 6
    public function run(array $args)
21
    {
22 6
        $this->expectArguments(
23 6
            'get',
24 6
            [0 => ['List', 'Vector', 'Hash'], 1 => ['Number', 'Symbol', 'String']],
25
            $args
26
        );
27 2
        return $args[0]->get($args[1]->value());
28
    }
29
}
30