TypeValidator::isNum()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
cc 2
nc 2
nop 1
crap 2
1
<?php
2
3
4
namespace Sarnado\Converter\Checkers;
5
6
7
class TypeValidator
8
{
9 207
    public static function isNum($amount): bool
10
    {
11 207
        if (!is_numeric($amount))
12
        {
13 120
            throw new \InvalidArgumentException('Must be numeric or string');
14
        }
15 207
        return true;
16
    }
17
}
18