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

Strings.php (4 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 Strings
6
{
7
    static function length_less_than( $str, $length )
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 strlen($str) < $length;
10
    }
11
    
12
    static function length_greater_than( $str, $length )
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 strlen($str) > $length;
15
    }
16
    
17
    static function match( $str, $regex )
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 preg_match($regex, $str) === 1;
20
    }
21
    
22
    static function is_email( $str )
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 \is_email( $str ) !== false;
25
    }
26
}