Completed
Push — master ( 8f5bc0...179bc9 )
by WEBEWEB
03:06
created

NumberHelper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A isNumber() 0 5 2
1
<?php
2
3
/**
4
 * This file is part of the core-library package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\Core\Argument;
13
14
use WBW\Library\Core\Exception\Argument\NumberArgumentException;
15
16
/**
17
 * Number helper.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Library\Core\Argument
21
 */
22
class NumberHelper {
23
24
    /**
25
     * Determines if a value is a number.
26
     *
27
     * @param mixed $value The value.
28
     * @throws NumberArgumentException Throws a Number argument exception if the value is not of expected type.
29
     */
30
    public static function isNumber($value) {
31
        if (false === is_numeric($value)) {
32
            throw new NumberArgumentException($value);
33
        }
34
    }
35
36
}
37