CallbackCheck
in package
implements
DiagnosticCheckInterface
Read onlyYes
FinalYes
A diagnostic check written as a closure.
The closure returns true (pass), false (fail with the default message),
a string (fail with that message) or a full CheckResult. Example:
new CallbackCheck('options', CheckScope::Boot, static fn (): bool|string =>
get_option('acme_settings') !== false ?: 'acme_settings option is missing');
Table of Contents
Interfaces
- DiagnosticCheckInterface
- Extension point for package- and host-level checks in the boot report.
Properties
- $callback : Closure
- $name : string
- $scope : CheckScope
Methods
- __construct() : mixed
- name() : string
- Short, stable label shown in the report (for example `schema`).
- run() : CheckResult
- Run the check now and describe the outcome.
- scope() : CheckScope
- The layer this check proves.
Properties
$callback
private
Closure
$callback
$name
private
string
$name
$scope
private
CheckScope
$scope
Methods
__construct()
public
__construct(string $name, CheckScope $scope,
Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 87
callable(): Array $callback) : mixed
Parameters
- $name : string
- $scope : CheckScope
- $callback : Warning: Array to string conversion in /opt/phpdoc/src/phpDocumentor/Transformer/Writer/Twig/LinkRenderer/CallableAdapter.php on line 87 callable(): Array
name()
Short, stable label shown in the report (for example `schema`).
public
name() : string
Return values
stringrun()
Run the check now and describe the outcome.
public
run() : CheckResult
Return values
CheckResultscope()
The layer this check proves.
public
scope() : CheckScope