DefaultNumberValidator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A isValid() 0 4 2
1
<?php
2
3
namespace Tdn\PhpTypes\Math;
4
5
/**
6
 * Class DefaultNumberValidator.
7
 */
8
class DefaultNumberValidator implements NumberValidatorInterface
9
{
10
    /**
11
     * Ensures scalar variable is a number.
12
     *
13
     * @param mixed $number
14
     *
15
     * @return bool
16
     */
17 52
    public function isValid($number): bool
18
    {
19 52
        return is_scalar($number) && is_numeric($number);
20
    }
21
}
22