Skip to content

LabelShare ​

Rasuvaeff\PropertyTesting\Runner\LabelShare

Class — Package: property-testing-core — Source — Version: v1.0.0-1-g88fdee2

How often one Classify label occurred, together with the Classify::cover() threshold it was registered with, if any.

The share is over the property's successful checks, never its attempts: a discarded run produced no input the label could describe, so counting it in the denominator would report a smaller share for the same generator merely because Assume::that() rejected more inputs.

Constructor ​

php
__construct(
    string $label,
    int $count,
    float $percent,
    ?float $required = NULL,
)
ParameterTypeDefaultDescription
$labelstringrequiredThe label as the property body recorded it.
$countintrequiredSuccessful checks that recorded it (once per run, however often it was called).
$percentfloatrequiredThat count as a percentage of the successful checks; 0.0 when there were none.
$required?floatNULLThe percentage Classify::cover() demanded, or null when the label was only classified. A required label the runs never reached still appears, with a count of zero — that is the case worth seeing.

Methods ​

meetsRequirement() ​

php
meetsRequirement(): bool

Whether the recorded share reaches the requirement. True for a label without one — there is nothing to miss.

This is arithmetic, not a verdict: whether the engine enforced it is Runner\DistributionReport::$coverageAssessed, because a run that gave up or ran out of budget never reached the assessment.