Skip to content

API overview

This page maps every @api-tagged type in src/ — the actual public contract, taken from a reflection pass (docs/scripts/reflect-api.php), not from what the README happens to mention. Every class name links to a generated reference page (docs/scripts/generate-api.mjs) listing its public properties and method signatures straight from that same reflection pass.

Where to start

TypeRole
PropertyThe #[Property] attribute — runs, seed, generators, maxShrinks, examples, maxDiscards, timeoutMs, budgetMs.
GenStatic factory for every built-in generator — see the generators overview.
AssumeAssume::that(bool) — discard the current attempt.
ArbitraryInterfaceImplement this to write a custom generator.
ShrinkableValue + lazy shrink tree — leaf(), of(), map(). See Shrinking.
CounterExampleThe falsified run's data — toArray(), toJson(), toExamplesCode().
Classifylabel(), when(), cover() — see Distribution.

State machine testing

TypeRole
CommandInterface: preCondition/nextState/run/postCondition + \Stringable.
CommandSequenceThe generated, shrinkable sequence of commands.
StateMachineStateMachine::check() — runs a sequence against a fresh system.

See State machine: concepts.

Failures

Every exception this package throws, with its actual readonly fields and getters (not just a name-drop): Exceptions reference.

Public, but not where you start

Two @api members exist for narrower, more advanced use than "write a #[Property] test":

  • Random::__construct(int $seed) — build a Random by hand to exercise a custom ArbitraryInterface in isolation, outside of a running property. Inside a property, Random is always injected by the runner.
  • Classify::beginRun() / flushRun() / flushRequirements() — the runner-lifecycle hooks PropertyInterceptor calls to reset and drain the per-run distribution buffer. Public because the interceptor lives in a different namespace (Internal\), not because test code is expected to call them.

AssumptionSkipped is deliberately absent from this map — it's public but not @api; see the note at the bottom of the exceptions reference.

This page and Exceptions are checked against a live reflection snapshot of src/, not hand-maintained from memory — see issue #29 for the gaps this closed.