Skip to content

Commit

Permalink
Fix CS v3.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Nov 2, 2022
1 parent e97ed7e commit e4f3f25
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/Field/PasswordField.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
use Atk4\Data\Field;
use Atk4\Data\Model;

use function password_get_info;
use function password_hash;
use function password_verify;

class PasswordField extends Field
{
/** @var int */
Expand All @@ -34,7 +30,7 @@ public function hashPassword(string $password): string
{
$password = $this->normalizePassword($password, false);

$hash = password_hash($password, \PASSWORD_BCRYPT, ['cost' => 8]);
$hash = \password_hash($password, \PASSWORD_BCRYPT, ['cost' => 8]);
$e = false;
try {
if (!$this->hashPasswordIsHashed($hash) || !$this->hashPasswordVerify($hash, $password)) {
Expand All @@ -54,7 +50,7 @@ public function hashPasswordVerify(string $hash, string $password): bool
$hash = $this->normalize($hash);
$password = $this->normalizePassword($password, true);

return password_verify($password, $hash);
return \password_verify($password, $hash);
}

public function hashPasswordIsHashed(string $value): bool
Expand All @@ -64,7 +60,7 @@ public function hashPasswordIsHashed(string $value): bool
} catch (\Exception $e) {
}

return password_get_info($value)['algo'] === \PASSWORD_BCRYPT;
return \password_get_info($value)['algo'] === \PASSWORD_BCRYPT;
}

public function normalize($hash): ?string
Expand Down

0 comments on commit e4f3f25

Please sign in to comment.