PendingRun
class PendingRun
Traits
Properties
| protected null|GroupContinuation): void | $observer | The callback used to observe each diagnostic group. |
|
| protected null|DiagnosticOutcome): bool|string | $fix | The callback that determines whether a failing diagnostic should be fixed. |
|
| protected null|Closure(): void | $beforeRerun | The callback invoked when applied fixes require the diagnostics to be re-run. |
|
| protected bool | $bail | Whether the run should stop after the first failing diagnostic. |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Constrain the run to diagnostics matching the given selectors.
Exclude diagnostics matching the given selectors from the run.
Stop the run after the first failing diagnostic.
Invoke the given callback when applied fixes require the diagnostics to be re-run.
Run the diagnostics.
Check the selected diagnostics and gather their outcomes into a report.
Check a diagnostic group while allowing its progress to be observed.
Check the given diagnostics.
Determine whether the outcomes contain a failure.
Apply the approved fixes for the report's failing diagnostics.
Details
in
Conditionable at line 23
mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
in
Conditionable at line 56
mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
at line 52
__construct(Doctor $doctor, DiagnosticSelection $selection)
Create a new pending diagnostic run.
at line 64
PendingRun
only(string ...$selectors)
Constrain the run to diagnostics matching the given selectors.
Selectors may reference a diagnostic class, class basename, group, or package name. Repeated calls intersect with previous constraints.
at line 74
PendingRun
except(string ...$selectors)
Exclude diagnostics matching the given selectors from the run.
at line 84
PendingRun
bail(bool $bail = true)
Stop the run after the first failing diagnostic.
at line 101
PendingRun
observeUsing(Closure $callback)
Observe each diagnostic group through the given callback.
The callback receives the group name and a controlled continuation that runs the group. The continuation accepts an optional "before" callback invoked before each diagnostic and an optional "after" callback invoked with each outcome.
at line 117
PendingRun
fixUsing(Closure $callback)
Apply fixes approved by the given callback.
The callback may return false to skip the fix, true to apply a plain fix, or one of the result's fix option values to apply the fix with that choice.
at line 127
PendingRun
beforeRerun(Closure $callback)
Invoke the given callback when applied fixes require the diagnostics to be re-run.
at line 137
DiagnosticReport
run()
Run the diagnostics.
at line 161
protected DiagnosticReport
check()
Check the selected diagnostics and gather their outcomes into a report.
at line 183
protected array
checkGroup(string $group, array $diagnostics)
Check a diagnostic group while allowing its progress to be observed.
at line 206
protected array
checkDiagnostics(array $diagnostics, Closure|null $before = null, Closure|null $after = null)
Check the given diagnostics.
at line 235
protected bool
hasFailure(array $outcomes)
Determine whether the outcomes contain a failure.
at line 252
protected array
fixes(DiagnosticReport $report, Closure $fix)
Apply the approved fixes for the report's failing diagnostics.