KMP PHP API Reference

SensitiveString
in package
implements JsonSerializable

FinalYes

Holds plaintext secret material while redacting common debug surfaces.

Table of Contents

Interfaces

JsonSerializable

Properties

$value  : string

Methods

__construct()  : mixed
Constructor.
__debugInfo()  : array<string, mixed>
__serialize()  : array<string, string>
__toString()  : string
Prevent implicit string conversion that could send redacted placeholders downstream.
__unserialize()  : void
isEmpty()  : bool
Check whether the secret value is empty.
jsonSerialize()  : string
Return a redacted JSON representation.
length()  : int
Return the plaintext length without revealing the value.
reveal()  : string
Reveal the plaintext secret value.

Properties

Methods

__construct()

Constructor.

public __construct(string $value) : mixed
Parameters
$value : string

Plaintext secret value

__debugInfo()

public __debugInfo() : array<string, mixed>
Return values
array<string, mixed>

__serialize()

public __serialize() : array<string, string>
Return values
array<string, string>

__toString()

Prevent implicit string conversion that could send redacted placeholders downstream.

public __toString() : string
Return values
string

__unserialize()

public __unserialize(array<string, mixed> $data) : void
Parameters
$data : array<string, mixed>

Serialized data

isEmpty()

Check whether the secret value is empty.

public isEmpty() : bool
Return values
bool

jsonSerialize()

Return a redacted JSON representation.

public jsonSerialize() : string
Return values
string

length()

Return the plaintext length without revealing the value.

public length() : int
Return values
int

reveal()

Reveal the plaintext secret value.

public reveal() : string
Return values
string
On this page

Search results