Skip to content

Commit 72ca785

Browse files
committed
removed deprecated stuff WIP
1 parent 3d46b38 commit 72ca785

File tree

2 files changed

+2
-38
lines changed

2 files changed

+2
-38
lines changed

src/Security/Passwords.php

+2-7
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@ public function hash(string $password): string
4646
throw new Nette\InvalidArgumentException('Password can not be empty.');
4747
}
4848

49-
$hash = isset($this)
50-
? @password_hash($password, $this->algo, $this->options) // @ is escalated to exception
51-
: @password_hash($password, PASSWORD_BCRYPT, func_get_args()[1] ?? []); // back compatibility with v2.x
52-
49+
$hash = @password_hash($password, $this->algo, $this->options); // @ is escalated to exception
5350
if (!$hash) {
5451
throw new Nette\InvalidStateException('Computed hash is invalid. ' . error_get_last()['message']);
5552
}
@@ -71,8 +68,6 @@ public function verify(string $password, string $hash): bool
7168
*/
7269
public function needsRehash(string $hash): bool
7370
{
74-
return isset($this)
75-
? password_needs_rehash($hash, $this->algo, $this->options)
76-
: password_needs_rehash($hash, PASSWORD_BCRYPT, func_get_args()[1] ?? []); // back compatibility with v2.x
71+
return password_needs_rehash($hash, $this->algo, $this->options);
7772
}
7873
}

tests/Security/Passwords.static.phpt

-31
This file was deleted.

0 commit comments

Comments
 (0)