Num::randomInt()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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 4
    public static function randomInt($min = PHP_INT_MIN, $max = PHP_INT_MAX)
16
    {
17 4
        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 2
    public static function format($number, $decimals = 0, $decPoint = '.', $thousandsSep = ',')
29
    {
30 2
        return \number_format($number, $decimals, $decPoint, $thousandsSep);
31
    }
32
33
}
34