class CliRenderer

Methods

__construct(OutputStyle $output)

Create a new CLI renderer instance.

void
render(DiagnosticReport $report)

Render the diagnostic report.

void
renderFixConfirmation(DiagnosticOutcome $outcome)

Render a diagnostic fix confirmation as a callout.

bool
isReportableIssue(DiagnosticOutcome $outcome)

Determine whether the diagnostic should be displayed as an issue.

void
renderIssue(DiagnosticOutcome $outcome, DiagnosticFixOutcome|null $failedFix = null)

Render an issue diagnostic as a callout.

string
issueCalloutType(DiagnosticOutcome $outcome, DiagnosticFixOutcome|null $failedFix)

Get the callout type for an issue, escalating when a fix failed.

array
failedFixesByDiagnostic(array $fixes)

Key the failed fixes by the diagnostic that attempted them.

void
renderDiagnosticDetails(DiagnosticOutcome $outcome)

Render diagnostic details, remediation, and links.

void
renderNotices(array $notices)

Render notice diagnostics as callouts grouped by source.

array
noticesBySource(array $notices)

Group notices by their source.

array
noticesCalloutContent(array $notices)

Format notice content for a callout.

string
noticeItem(DiagnosticOutcome $outcome)

Format a notice as a compact list item.

void
renderFixes(array $fixes)

Render diagnostic fixes as callouts grouped by source.

array
fixesBySource(array $fixes)

Group fixes by their source.

array
fixesCalloutContent(array $fixes)

Format fix content for a callout.

string
fixItem(DiagnosticFixOutcome $outcome)

Format a fix outcome as a compact list item.

string
fixSummary(DiagnosticFixOutcome $outcome)

Format a fix outcome's summary and details as a single line.

string|null
fixesCalloutType(array $fixes)

Get the callout type for the fix outcomes.

array
diagnosticCalloutContent(DiagnosticOutcome $outcome, bool $includeRemediation = true, DiagnosticFixOutcome|null $failedFix = null)

Format diagnostic content for a callout.

array
fixConfirmationCalloutContent(DiagnosticOutcome $outcome)

Format fix confirmation content for a callout.

promptLink(Link $link)

Format a related link as a native Prompts element with a shortened URL.

Details

at line 30
__construct(OutputStyle $output)

Create a new CLI renderer instance.

Parameters

OutputStyle $output

at line 37
void render(DiagnosticReport $report)

Render the diagnostic report.

Parameters

DiagnosticReport $report

Return Value

void

at line 110
void renderFixConfirmation(DiagnosticOutcome $outcome)

Render a diagnostic fix confirmation as a callout.

Parameters

DiagnosticOutcome $outcome

Return Value

void

at line 123
protected bool isReportableIssue(DiagnosticOutcome $outcome)

Determine whether the diagnostic should be displayed as an issue.

Parameters

DiagnosticOutcome $outcome

Return Value

bool

at line 131
protected void renderIssue(DiagnosticOutcome $outcome, DiagnosticFixOutcome|null $failedFix = null)

Render an issue diagnostic as a callout.

Parameters

DiagnosticOutcome $outcome
DiagnosticFixOutcome|null $failedFix

Return Value

void

at line 144
protected string issueCalloutType(DiagnosticOutcome $outcome, DiagnosticFixOutcome|null $failedFix)

Get the callout type for an issue, escalating when a fix failed.

Parameters

DiagnosticOutcome $outcome
DiagnosticFixOutcome|null $failedFix

Return Value

string

at line 159
protected array failedFixesByDiagnostic(array $fixes)

Key the failed fixes by the diagnostic that attempted them.

Parameters

array $fixes

Return Value

array

at line 175
protected void renderDiagnosticDetails(DiagnosticOutcome $outcome)

Render diagnostic details, remediation, and links.

Parameters

DiagnosticOutcome $outcome

Return Value

void

at line 195
protected void renderNotices(array $notices)

Render notice diagnostics as callouts grouped by source.

Parameters

array $notices

Return Value

void

at line 216
protected array noticesBySource(array $notices)

Group notices by their source.

Parameters

array $notices

Return Value

array

at line 230
protected array noticesCalloutContent(array $notices)

Format notice content for a callout.

Parameters

array $notices

Return Value

array

at line 248
protected string noticeItem(DiagnosticOutcome $outcome)

Format a notice as a compact list item.

Parameters

DiagnosticOutcome $outcome

Return Value

string

at line 268
protected void renderFixes(array $fixes)

Render diagnostic fixes as callouts grouped by source.

Parameters

array $fixes

Return Value

void

at line 290
protected array fixesBySource(array $fixes)

Group fixes by their source.

Parameters

array $fixes

Return Value

array

at line 304
protected array fixesCalloutContent(array $fixes)

Format fix content for a callout.

Parameters

array $fixes

Return Value

array

at line 319
protected string fixItem(DiagnosticFixOutcome $outcome)

Format a fix outcome as a compact list item.

Parameters

DiagnosticFixOutcome $outcome

Return Value

string

at line 327
protected string fixSummary(DiagnosticFixOutcome $outcome)

Format a fix outcome's summary and details as a single line.

Parameters

DiagnosticFixOutcome $outcome

Return Value

string

at line 343
protected string|null fixesCalloutType(array $fixes)

Get the callout type for the fix outcomes.

Parameters

array $fixes

Return Value

string|null

at line 365
protected array diagnosticCalloutContent(DiagnosticOutcome $outcome, bool $includeRemediation = true, DiagnosticFixOutcome|null $failedFix = null)

Format diagnostic content for a callout.

Parameters

DiagnosticOutcome $outcome
bool $includeRemediation
DiagnosticFixOutcome|null $failedFix

Return Value

array

at line 396
protected array fixConfirmationCalloutContent(DiagnosticOutcome $outcome)

Format fix confirmation content for a callout.

Parameters

DiagnosticOutcome $outcome

Return Value

array

Format a related link as a native Prompts element with a shortened URL.

Parameters

Link $link

Return Value

Link