Completed
Pull Request — master (#5)
by ARCANEDEV
02:37
created

NumberChecker::isIntValue()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 1
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 2
rs 10
1
<?php namespace Arcanedev\Gravatar\Helpers;
2
3
/**
4
 * Class     NumberChecker
5
 *
6
 * @package  Arcanedev\Gravatar\Helpers
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class NumberChecker
10
{
11
    /* -----------------------------------------------------------------
12
     |  Main Methods
13
     | -----------------------------------------------------------------
14
     */
15
16
    /**
17
     * Check if an integer is between two values.
18
     *
19
     * @param  int  $value
20
     * @param  int  $min
21
     * @param  int  $max
22
     *
23
     * @return bool
24
     */
25 32
    public static function isIntBetween($value, $min, $max)
26
    {
27 32
        return $value >= $min && $value <= $max;
28
    }
29
30
    /**
31
     * Check if value is integer.
32
     *
33
     * @param  mixed  $value
34
     *
35
     * @return bool
36
     */
37 32
    public static function isIntValue($value)
38
    {
39 32
        return is_int($value) || ctype_digit($value);
40
    }
41
}
42