Completed
Push — master ( e7b529...3b65c3 )
by Scott
02:52
created

VectorQuestion::run()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.6666
c 0
b 0
f 0
cc 3
eloc 6
nc 3
nop 1
crap 3
1
<?php
2
namespace Desmond\functions\core;
3
use Desmond\functions\DesmondFunction;
4
use Desmond\ArgumentHelper;
5
use Desmond\exceptions\ArgumentException;
6
7
class VectorQuestion extends DesmondFunction
8
{
9
    use ArgumentHelper;
10
11 260
    public function id()
12
    {
13 260
        return 'vector?';
14
    }
15
16 3
    public function run(array $args)
17
    {
18 3
        if (empty($args)) {
19 1
            throw new ArgumentException('"vector?" expects an argument.');
20
        }
21 2
        return $this->isDesmondType('Vector', $args[0])
22 1
            ? $this->newReturnType('True')
23 2
            : $this->newReturnType('False');
24
    }
25
}
26