KMP PHP API Reference

PlatformHealthStatus
in package

FinalYes

Safe platform metadata database health report.

Table of Contents

Constants

STATE_DEGRADED  : mixed = 'degraded'
STATE_HEALTHY  : mixed = 'healthy'

Properties

$checkedAt  : DateTimeImmutable
$connectionName  : string
$errorClass  : string|null
$message  : string
$retriesAttempted  : int
$state  : string

Methods

__construct()  : mixed
Constructor.
degraded()  : self
Create a degraded status without leaking connection settings.
healthy()  : self
Create a healthy status.
isHealthy()  : bool
Whether platform metadata is available.
toSafeArray()  : array<string, mixed>
Return a diagnostics-safe array without connection details or secrets.

Constants

Properties

Methods

__construct()

Constructor.

public __construct(string $state, string $connectionName, string $message, DateTimeImmutable $checkedAt[, string|null $errorClass = null ][, int $retriesAttempted = 0 ]) : mixed
Parameters
$state : string

Health state

$connectionName : string

Datasource alias checked

$message : string

Safe diagnostic message

$checkedAt : DateTimeImmutable

Time of check

$errorClass : string|null = null

Exception class, when degraded

$retriesAttempted : int = 0

Number of retries attempted

degraded()

Create a degraded status without leaking connection settings.

public static degraded(string $connectionName, string $errorClass[, int $retriesAttempted = 0 ]) : self
Parameters
$connectionName : string

Datasource alias checked

$errorClass : string

Exception class

$retriesAttempted : int = 0

Number of retries attempted

Return values
self

healthy()

Create a healthy status.

public static healthy(string $connectionName[, int $retriesAttempted = 0 ]) : self
Parameters
$connectionName : string

Datasource alias checked

$retriesAttempted : int = 0

Number of retries attempted

Return values
self

isHealthy()

Whether platform metadata is available.

public isHealthy() : bool
Return values
bool

toSafeArray()

Return a diagnostics-safe array without connection details or secrets.

public toSafeArray() : array<string, mixed>
Return values
array<string, mixed>
On this page

Search results