final class Coverage

Builds the coverage report and applies the overall, per-source and differential gates.

Methods§

public function report(
    Project $project,
    Analysis $analysis,
    string|null $snapshotFile = null,
    bool $allowRemoved = false,
    float|null $minimum = null,
    float|null $diffMinimum = null,
): array<string, mixed>

Builds the coverage report of an analysis.

Parameters

$projectProjectThe loaded project
$analysisAnalysisThe analysis of its sources
$snapshotFilestring|nullThe coverage snapshot of a trusted base revision to compare with
$allowRemovedboolWhether units the snapshot lists may be missing from the scope
$minimumfloat|nullThe overall threshold, overriding the configured one
$diffMinimumfloat|nullThe differential threshold, overriding the configured one

Returns

array<string, mixed> The report; "passed" is false when a gate fails

Throws

InvalidInputException When the snapshot cannot be read or is not a coverage snapshot
JsonException When the snapshot is not JSON or a record cannot be encoded
Test cases 14
Called from 1
Calls 4

Test cases 17§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 11
Other tests reaching this symbol 6

Relations§

Instantiated in 1
Method calls 1