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
STATE_DEGRADED
public
mixed
STATE_DEGRADED
= 'degraded'
STATE_HEALTHY
public
mixed
STATE_HEALTHY
= 'healthy'
Properties
$checkedAt read-only
public
DateTimeImmutable
$checkedAt
$connectionName read-only
public
string
$connectionName
$errorClass read-only
public
string|null
$errorClass
= null
$message read-only
public
string
$message
$retriesAttempted read-only
public
int
$retriesAttempted
= 0
$state read-only
public
string
$state
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
selfhealthy()
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
selfisHealthy()
Whether platform metadata is available.
public
isHealthy() : bool
Return values
booltoSafeArray()
Return a diagnostics-safe array without connection details or secrets.
public
toSafeArray() : array<string, mixed>