Skip to content

Commit

Permalink
removed deprecated stuff WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Oct 6, 2020
1 parent 67011c3 commit 7543e35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 38 deletions.
9 changes: 2 additions & 7 deletions src/Security/Passwords.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ public function hash(string $password): string
throw new Nette\InvalidArgumentException('Password can not be empty.');
}

$hash = isset($this)
? @password_hash($password, $this->algo, $this->options) // @ is escalated to exception
: @password_hash($password, PASSWORD_BCRYPT, func_get_args()[1] ?? []); // back compatibility with v2.x

$hash = @password_hash($password, $this->algo, $this->options); // @ is escalated to exception
if (!$hash) {
throw new Nette\InvalidStateException('Computed hash is invalid. ' . error_get_last()['message']);
}
Expand All @@ -71,8 +68,6 @@ public function verify(string $password, string $hash): bool
*/
public function needsRehash(string $hash): bool
{
return isset($this)
? password_needs_rehash($hash, $this->algo, $this->options)
: password_needs_rehash($hash, PASSWORD_BCRYPT, func_get_args()[1] ?? []); // back compatibility with v2.x
return password_needs_rehash($hash, $this->algo, $this->options);
}
}
31 changes: 0 additions & 31 deletions tests/Security/Passwords.static.phpt

This file was deleted.

0 comments on commit 7543e35

Please sign in to comment.