IntegerTrait::validateInteger()   A
last analyzed

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 IntegerTrait
10
{
11
    use AbstractRuleTrait;
12
13 16
    private function validateInteger($value)
14
    {
15 16
        if (!is_integer($value)) {
16 13
            $this->throwInvalidArgumentMustBe("integer");
17
        }
18 3
    }
19
}
20