Password
in package
Read onlyYes
FinalYes
Password value object
Table of Contents
Properties
- $hash : string
Methods
- create() : self
- fromHash() : self
- getHash() : string
- Returns hash of a password
- verify() : bool
- Verifies plain password against this password hash
- __construct() : mixed
Properties
$hash
private
string
$hash
Methods
create()
public
static create(string $plainPassword[, int $minLength = 8 ]) : self
Parameters
- $plainPassword : string
- $minLength : int = 8
Tags
Attributes
- #[NoDiscard]
Return values
selffromHash()
public
static fromHash(string $hash) : self
Parameters
- $hash : string
Attributes
- #[NoDiscard]
Return values
selfgetHash()
Returns hash of a password
public
getHash() : string
Return values
stringverify()
Verifies plain password against this password hash
public
verify(string $plainPassword) : bool
Parameters
- $plainPassword : string
Return values
bool —match
__construct()
private
__construct(string $hash) : mixed
Parameters
- $hash : string