Completed
Push — master ( d9ca78...e2f2ea )
by Askupa
01:23
created

Number.php (6 issues)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Amarkal\Validation;
4
5
class Number
6
{
7
    static function is_numeric( $num )
0 ignored issues
show
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...
8
    {
9
        return \is_numeric($num);
10
    }
11
    
12
    static function is_int( $num )
0 ignored issues
show
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...
13
    {
14
        return \is_int($num);
15
    }
16
    
17
    static function is_float( $num )
0 ignored issues
show
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...
18
    {
19
        return \is_float($num);
20
    }
21
    
22
    static function less_than( $num, $limit )
0 ignored issues
show
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...
23
    {
24
        return self::is_numeric($num) && $num < $limit;
25
    }
26
    
27
    static function greater_than( $num, $limit )
0 ignored issues
show
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...
28
    {
29
        return self::is_numeric($num) && $num > $limit;
30
    }
31
    
32
    static function in_range( $num, $min, $max, $inclusive = false )
0 ignored issues
show
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...
33
    {
34
        if($inclusive)
35
        {
36
            return self::is_numeric($num) && $num <= $max && $num >= $min;
37
        }
38
        return self::is_numeric($num) && $num < $max && $num > $min;
39
    }
40
}