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

EmptyQuestion::run()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 4
nc 4
nop 1
crap 3
1
<?php
2
namespace Desmond\functions\core;
3
use Desmond\functions\DesmondFunction;
4
use Desmond\ArgumentHelper;
5
6
class EmptyQuestion extends DesmondFunction
7
{
8
    use ArgumentHelper;
9
10 260
    public function id()
11
    {
12 260
        return 'empty?';
13
    }
14
15 5
    public function run(array $args)
16
    {
17 5
        return (empty($args)) || empty($args[0]->value())
18 3
            ? $this->newReturnType('True')
19 5
            : $this->newReturnType('False');
20
    }
21
}
22