DiagnosticResult
class DiagnosticResult
Properties
| bool | $fixable | Whether this result represents an outcome the diagnostic can fix. |
|
| EnvironmentMode> | $fixableEnvironments | The environment modes in which the diagnostic's fix may be applied. |
|
| string|null | $details | ||
| string|null | $remediation | The remediation message for the result. |
|
| Link> | $links | The related links for the result. |
|
| array<string, mixed> | $context | The structured context for the result. |
|
| string|null | $confirmation | ||
| array<string, string> | $fixOptions | The choices for the diagnostic's fix, keyed by option value. |
|
| string|null | $fixDeclineLabel | The label for the select entry that declines a fix offering options. |
Methods
Create a new diagnostic result instance.
Create a passing diagnostic result.
Create a warning diagnostic result.
Create a notice diagnostic result.
Create a failing diagnostic result.
Create a skipped diagnostic result.
Create an error diagnostic result.
Add evidence to the diagnostic result.
Add remediation text to the diagnostic result.
Set the confirmation prompt for the diagnostic fix.
Mark this result as eligible for the diagnostic's fix.
Offer a choice of repairs for the diagnostic's fix.
Determine whether the fix may be applied in the given environment mode.
Add context to the diagnostic result.
Details
at line 70
__construct(Status $status, string $summary, string|null $code = null)
Create a new diagnostic result instance.
at line 80
static DiagnosticResult
pass(string $summary = 'Passed', string|null $code = null)
Create a passing diagnostic result.
at line 88
static DiagnosticResult
warn(string $summary, string|null $code = null)
Create a warning diagnostic result.
at line 96
static DiagnosticResult
notice(string $summary, string|null $code = null)
Create a notice diagnostic result.
at line 104
static DiagnosticResult
fail(string $summary, string|null $code = null)
Create a failing diagnostic result.
at line 112
static DiagnosticResult
skip(string $summary, string|null $code = null)
Create a skipped diagnostic result.
at line 120
static DiagnosticResult
error(string $summary, string|null $code = null)
Create an error diagnostic result.
at line 132
DiagnosticResult
withDetails(string $details)
Add evidence to the diagnostic result.
Prefer message tokens for short identifying values like versions, paths, constraints, or counts. Use details for unbounded or multi-line evidence such as exception messages, process output, and bullet lists.
at line 142
DiagnosticResult
suggest(string $message)
Add remediation text to the diagnostic result.
at line 152
DiagnosticResult
confirmUsing(string $prompt)
Set the confirmation prompt for the diagnostic fix.
at line 162
DiagnosticResult
fixable(EnvironmentMode ...$environments)
Mark this result as eligible for the diagnostic's fix.
at line 176
DiagnosticResult
fixOptions(array $options, string|null $decline = null)
Offer a choice of repairs for the diagnostic's fix.
at line 187
bool
fixableIn(EnvironmentMode $environment)
Determine whether the fix may be applied in the given environment mode.
at line 197
DiagnosticResult
link(Link $link)
Add a related link to the diagnostic result.
at line 207
DiagnosticResult
withContext(string $key, mixed $value)
Add context to the diagnostic result.