| Total Complexity | 5 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | final class PasswordHash implements HashFunctionInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var int Algorithm. |
||
| 14 | */ |
||
| 15 | private $algorithm; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var array Options. |
||
| 19 | */ |
||
| 20 | private $options; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * See http://php.net/manual/en/function.password-hash.php for details. |
||
| 24 | * |
||
| 25 | * @param int $algorithm Algorithm. |
||
| 26 | * @param array $options Options. |
||
| 27 | */ |
||
| 28 | 1 | public function __construct(int $algorithm = PASSWORD_DEFAULT, array $options = []) |
|
| 32 | 1 | } |
|
| 33 | |||
| 34 | /** |
||
| 35 | * {@inheritDoc} |
||
| 36 | */ |
||
| 37 | 2 | public function hash(string $password): string |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * {@inheritDoc} |
||
| 55 | */ |
||
| 56 | 2 | public function compare(string $password, string $hash): bool |
|
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @throws ErrorException Error converted to an exception. |
||
| 63 | */ |
||
| 64 | 1 | private static function errorHandler(int $severity, string $message, string $filename, int $line): void |
|
| 69 |