ConsistencyReport
final class ConsistencyReport (View source)
Shapes check results and fix-all tallies the same way for every backend strategy.
Methods
A check result: success with $allClear when there are no findings, otherwise $status with $countedFormat filled with the number of findings.
No description
Apply $repair to every id, counting the outcomes as [$successKey => n, 'failed' => n].
The message for a fix-all outcome from repairEach(): $nothing when there was nothing to repair, $allFormat with the count when every repair succeeded, and $partialFormat with both counts (a warning) otherwise.
The ids of every finding, for handing to repairEach().
Details
static array
build(array $findings, string $allClear, string $status, string $countedFormat)
A check result: success with $allClear when there are no findings, otherwise $status with $countedFormat filled with the number of findings.
static array
allClear(string $message)
No description
static array
repairEach(array $ids, callable $repair, string $successKey)
Apply $repair to every id, counting the outcomes as [$successKey => n, 'failed' => n].
An exception from a repair counts as a failure and does not stop the run.
static array
tally(array $counts, string $successKey, string $nothing, string $allFormat, string $partialFormat)
The message for a fix-all outcome from repairEach(): $nothing when there was nothing to repair, $allFormat with the count when every repair succeeded, and $partialFormat with both counts (a warning) otherwise.
static array
findingIds(array $result)
The ids of every finding, for handing to repairEach().