Completed
Push — master ( c74065...36962d )
by ARCANEDEV
10s
created

helpers.php ➔ is_int_not_between()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 3
dl 0
loc 4
rs 10
1
<?php
2
3
if ( ! function_exists('gravatar')) {
4
    /**
5
     * Get the gravatar instance.
6
     *
7
     * @return Arcanedev\Gravatar\Contracts\Gravatar
8
     */
9
    function gravatar()
10
    {
11
        return app(Arcanedev\Gravatar\Contracts\Gravatar::class);
12
    }
13
}
14
15
if ( ! function_exists('is_val_integer')) {
16
    /**
17
     * Check if value is integer.
18
     *
19
     * @param  mixed  $value
20
     *
21
     * @return bool
22
     */
23
    function is_val_integer($value)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
24
    {
25
        return is_int($value) || ctype_digit($value);
26
    }
27
}
28
29
if ( ! function_exists('is_int_not_between')) {
30
    /**
31
     * Check if an integer is between two values.
32
     *
33
     * @param  int         $needle
34
     * @param  int         $min
35
     * @param  int         $max
36
     *
37
     * @return bool
38
     */
39
    function is_int_not_between($needle, $min, $max)
40
    {
41
        return $needle < $min  || $needle >  $max;
42
    }
43
}
44