TypeValidator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A isNum() 0 7 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