These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace Redaxscript\Validator; |
||
3 | |||
4 | use Redaxscript\Hash; |
||
5 | |||
6 | /** |
||
7 | * children class to validate password |
||
8 | * |
||
9 | * @since 2.6.0 |
||
10 | * |
||
11 | * @package Redaxscript |
||
12 | * @category Validator |
||
13 | * @author Henry Ruhs |
||
14 | */ |
||
15 | |||
16 | class Password implements ValidatorInterface |
||
17 | { |
||
18 | /** |
||
19 | * validate the password |
||
20 | * |
||
21 | * @since 4.0.0 |
||
22 | * |
||
23 | * @param string $password plain password |
||
24 | * @param string $hash hashed password |
||
25 | * |
||
26 | * @return bool |
||
27 | */ |
||
28 | |||
29 | 3 | public function validate(string $password = null, string $hash = null) : bool |
|
30 | { |
||
31 | 3 | $passwordHash = new Hash(); |
|
32 | 3 | return $password && $passwordHash->validate($password, $hash); |
|
0 ignored issues
–
show
|
|||
33 | } |
||
34 | } |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: