Skip to content

v0.10.0

Choose a tag to compare

@github-actions github-actions released this 06 Sep 17:22
· 31 commits to master since this release
9196814
  • Changed. Matching indexes routes by method, segment count and first
    literal segment instead of scanning every operation and every one of its
    servers on each request. On a thousand-operation document a validated request
    went from 0.83 ms to 0.006 ms, and the cost no longer grows with the
    document. Selection is unchanged by construction: each key is a property
    matchPath() checks before anything else, and candidates are ordered by a
    comparator that ends on the unique operation key, so the winner never
    depended on the order they were collected in.

  • Added. Two examples: gate-a-request.php (the shape a PSR-15 middleware
    takes, over a multi-file document) and budgets.php (Limits, and why
    *.body.too_large is a refusal to read rather than a verdict).

  • Documentation. Three divergences from the specification are now written
    down rather than merely true: a percent-encoded delimiter inside a
    pipeDelimited/spaceDelimited value is folded into the delimiter, a Header
    Object carrying name/in is ignored rather than refused, and example
    with examples are both kept instead of being refused as mutually exclusive.
    No behaviour changed: the first agrees with how a PHP application reads the
    same query, and changing it would break that agreement to gain agreement with
    the text.

  • Fixed. A YAML document under a kilobyte could exhaust memory and die with
    a fatal error rather than an InvalidContract. Anchors and aliases expand
    inside the parser, before any budget measures anything, and the byte budget
    measures the file; the reference resolver's own budget counts only the nodes
    it descends into, and it rightly does not descend into data — which is where
    an alias is just as welcome. Nine levels of anchors in an enum turned 772
    bytes into 387 million nodes. Documents are now measured by what they expand
    into, at every entry point and shared across a multi-file graph.

  • Added. Limits::$documentNodes (default 5 000 000, constant
    Limits::DEFAULT_DOCUMENT_NODES) — the budget above. It sits above what any
    document within documentBytes can hold, so it refuses amplification without
    refusing size. Counting stops at the budget, so an oversized document costs
    the budget rather than its own size.

  • Changed. The message-reading trait joined the mutation gate's coverage
    map: it was in no #[Covers], and so produced no mutants at all — the body
    reading loop, its byte-budget comparison included, was outside the gate. The
    package's own AGENTS.md names that as the symptom.