AuthSecret
in package
Class representing a secret code value object
Table of Contents
- $secret : string
- Secret value
- byRandomValue() : AuthSecret
- Return an instance with a randomly Base32-encoded value
- code() : string
- Return the secret value
- withCode() : AuthSecret
- Return an instance with the provided secret
- __construct() : mixed
- Create instance
Properties
$secret
Secret value
private
string
$secret
Methods
byRandomValue()
Return an instance with a randomly Base32-encoded value
public
static byRandomValue([int $length = 16 ]) : AuthSecret
Parameters
- $length : int = 16
-
Length of secret
Return values
AuthSecret —Instance
code()
Return the secret value
public
code() : string
Return values
string —Secret value
withCode()
Return an instance with the provided secret
public
static withCode(NonEmptyStringType $secret) : AuthSecret
Parameters
- $secret : NonEmptyStringType
-
Secret
Return values
AuthSecret —Instance
__construct()
Create instance
private
__construct(string $secret) : mixed
Parameters
- $secret : string
-
Secret