Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | 12 | public function authenticateEntity($correctPassphrase, $suppliedPassphrase) |
|
32 | { |
||
33 | 12 | if (!is_string($correctPassphrase)) { |
|
34 | 4 | throw new \InvalidArgumentException( |
|
35 | 4 | 'The correct token value for verification must be a string or a binary string.' |
|
36 | 4 | ); |
|
37 | 8 | } elseif (!is_string($suppliedPassphrase)) { |
|
38 | 4 | throw new \InvalidArgumentException( |
|
39 | 4 | 'The supplied user token value must be a string or a binary string.' |
|
40 | 4 | ); |
|
41 | } |
||
42 | |||
43 | 4 | return hash_equals($correctPassphrase, $suppliedPassphrase); |
|
44 | } |
||
46 |