Passed
Push — master ( a9ba5a...6cd513 )
by Бабичев
02:53
created

Num   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A randomInt() 0 4 1
A format() 0 4 1
1
<?php
2
3
namespace Bavix\Helpers;
4
5
class Num
6
{
7
8
    /**
9
     * @param int $min
10
     * @param int $max
11
     *
12
     * @return int
13
     * @throws \Exception
14
     */
15 1
    public static function randomInt($min = PHP_INT_MIN, $max = PHP_INT_MAX)
16
    {
17 1
        return \random_int($min, $max);
18
    }
19
20
    /**
21
     * @param int|float|double $number
22
     * @param int              $decimals
23
     * @param string           $decPoint
24
     * @param string           $thousandsSep
25
     *
26
     * @return string
27
     */
28 1
    public static function format($number, $decimals = 0, $decPoint = '.', $thousandsSep = ',')
29
    {
30 1
        return \number_format($number, $decimals, $decPoint, $thousandsSep);
31
    }
32
33
}
34