Skip to content

Commit 37ca1ea

Browse files
committed
removed deprecated stuff WIP
1 parent 972cf4f commit 37ca1ea

File tree

2 files changed

+2
-37
lines changed

2 files changed

+2
-37
lines changed

src/Security/Passwords.php

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

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

tests/Security/Passwords.static.phpt

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)