EnvironmentOverrides
Rasuvaeff\PropertyTesting\Runner\EnvironmentOverrides
Class — Package: property-testing-core — Source — Version: v1.0.0-1-g88fdee2
The values of the PROPERTY_* environment variables, parsed.
The adapters read the environment — the engine never does — and every one of them has to turn the same strings into the same values with the same refusals, or PROPERTY_RUNS=abc would mean one thing under Testo and another under PHPUnit. Each parser takes the raw value as getenv() hands it over (false when unset) and answers with the parsed value, or null when the variable is unset or empty and the caller's own default applies.
$runs = EnvironmentOverrides::runs(getenv('PROPERTY_RUNS')) ?? $attribute->runs;Methods
runs()
static runs(string|false $value): ?intPROPERTY_RUNS: a positive integer.
$value— The variable's value asgetenv()reports it;falsewhen unset.
Throws:
InvalidArgumentException— When the value is not a positive integer within range.
count()
static count(string $variable, string|false $value): ?intA count variable such as PROPERTY_SEARCH_RUNS: a non-negative integer, where 0 means "none" and is a valid way to switch a phase off from the environment.
$variable— The variable's name, for the message.$value— The variable's value asgetenv()reports it;falsewhen unset.
Throws:
InvalidArgumentException— When the value is not a non-negative integer within range.
seed()
static seed(string|false $value): ?intPROPERTY_SEED: an integer. A value past the integer range would saturate to PHP_INT_MAX under a cast, and a replay under "the same" seed would then be a different run.
$value— The variable's value asgetenv()reports it;falsewhen unset.
Throws:
InvalidArgumentException— When the value is not an integer within range.
phases()
static phases(string|false $value): ?arrayPROPERTY_PHASES: a comma-separated list of phase names, case-insensitive (examples,corpus is the fast pull-request gate). An unknown name is an error rather than a skipped stage — a run that silently performed fewer stages would report green having checked less.
$value— The variable's value asgetenv()reports it;falsewhen unset.
Throws:
InvalidArgumentException— When a name is not a phase.
edgeCases()
static edgeCases(string|false $value): ?Runner\EdgeCasesPROPERTY_EDGE_CASES: mixin or none, case-insensitive. An unknown value is an error rather than a silent fallback — a suite that quietly kept the bias it was told to drop would spend the discard budget it was trying to save.
$value— The variable's value asgetenv()reports it;falsewhen unset.
Throws:
InvalidArgumentException— When the value is neithermixinnornone.
flag()
static flag(string|false $value): ?boolA switch such as PROPERTY_DERANDOMIZE or PROPERTY_VERBOSE: unset and empty mean "not given" (null); 0, false, off and no mean off (case-insensitively, surrounding whitespace ignored); anything else on.
$value— The variable's value asgetenv()reports it;falsewhen unset.
The written-out spellings are here because a shell exports words as readily as digits, and PROPERTY_VERBOSE=false turning verbose output on is a bug report waiting to happen — the value says off in every language the reader knows.
string()
static string(string|false $value): ?stringA free-form value such as PROPERTY_PATH or PROPERTY_DB: the string, or null when unset or empty.
$value— The variable's value asgetenv()reports it;falsewhen unset.