Verification
in package
The outcome of a {@see Password::verify()} call; read it via {@see isCorrect()}.
When the password is correct but its stored hash is stale, it keeps the plaintext so the fresh native hash can be produced on demand (rehash-on-login). Hashing is deferred to upgradePassword(), so a plain isCorrect() check never pays for it. Immutable; obtained only from the verifier.
Table of Contents
- $correct : bool
- $upgradePlaintext : string|null
- isCorrect() : bool
- Whether the supplied password was correct.
- isUpgradeNeeded() : bool
- Whether a fresh hash should be persisted after this (correct) verify.
- upgradePassword() : string
- The fresh native hash to persist. Run after isUpgradeNeeded()
- __construct() : mixed
Properties
$correct
private
bool
$correct
$upgradePlaintext
private
string|null
$upgradePlaintext
Methods
isCorrect()
Whether the supplied password was correct.
public
isCorrect() : bool
Return values
bool —isUpgradeNeeded()
Whether a fresh hash should be persisted after this (correct) verify.
public
isUpgradeNeeded() : bool
Return values
bool —upgradePassword()
The fresh native hash to persist. Run after isUpgradeNeeded()
public
upgradePassword() : string
Tags
Return values
string —__construct()
private
__construct(bool $correct, string|null $upgradePlaintext) : mixed
Parameters
- $correct : bool
- $upgradePlaintext : string|null