Repository navigation
v2.5.0
Correctness release. Generators never hand a property an out-of-domain value,
and a property that checks nothing no longer passes silently. Behaviour changes
below are bug fixes, but observable — review if you relied on the old behaviour.
Gen::filter()now throwsGenerationExhausted(new@apiexception)
after 100 rejected draws, instead of returning the last (predicate-failing)
value. The interceptor catches it at the generation step and reports a clean
failure. Exhaustion can be transient (a satisfiable-but-rare predicate) — widen
the source, raise the budget, or useGen::flatMap()for dependent domains.runsnow means successful checks. Discarded attempts do not consume the
requested run count. The new trailingProperty::$maxDiscardsoption bounds
retries (default:runs * 10); exceeding it fails withGaveUpException,
which exposes required/successful/discarded/attempt counts.- Sized collections guarantee their minimum.
Gen::dictOf()now keeps
distinct keys (was: colliding keys overwrite) andGen::commands()throws when
no applicable command reaches$minLength; both, plusGen::uniqueArrayOf(),
now signal an unreachable minimum withGenerationExhausted.
Gen::uniqueArrayOf()previously threwInvalidArgumentExceptionfor this case
— the type changed toGenerationExhausted(extendsRuntimeException). - Counterexamples render nested values. Arrays and objects are shown
recursively (bounded depth/width/length, special floats and binary strings
labelled, object cycles guarded) instead of[N element(s)]/ a bare class
name — inPropertyViolationException,ExampleViolationExceptionand the
verbose run log. Object rendering includes private/protected properties (real
DTOs across their inheritance chain), and strings, map keys andStringable
output are escaped and bounded so a value stays on one unambiguous line.
CounterExample::toArray()/toJson()provide machine-readable output;
toExamplesCode()produces a runnable examples-method fragment for values
that PHP can represent directly. - Removed the unsupported
Attribute::TARGET_FUNCTIONfrom#[Property]; it only
ever ran on methods.