Completed
Push — master ( a1763f...fff075 )
by Štefan
03:03
created

NotEmptyTrait::validateNotEmpty()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 4
cts 5
cp 0.8
rs 9.4285
cc 2
eloc 3
nc 2
nop 1
crap 2.032
1
<?php
2
3
4
namespace Webcore\Validation\Rules;
5
6
7
use Webcore\Validation\AbstractRuleTrait;
8
9
trait NotEmptyTrait
10
{
11
    use AbstractRuleTrait;
12
13 11
    private function validateNotEmpty($value)
14
    {
15 11
        if ($value === null) {
16 1
            $this->throwInvalidArgumentMustBe("not empty");
17
        }
18 10
    }
19
}
20