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

EmptyQuestion   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A id() 0 4 1
A run() 0 6 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