Repository navigation
Add budgetMs(), cause(), value generics and values-only wire codec (0.5.0) - #32
Conversation
|
Sorry @rasuvaeff, you've used your own review budget of 250,000 diff characters for the last 7 days. You can request another review in 6 days by commenting |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Reviewer's GuideAPIExpose typed context values and termination inspection, and add a positive-millisecond budget that checks activity after reading the remainder.
Add values-only wire methods and centralize parsing of incoming budgets while keeping encode and decode built on those operations.
ImplementationRemove the retained parent context link and consolidate seconds-to-nanoseconds conversion for timeout, reserve, and sleep calculations.
Release the process-wide pending-request count when an unobserved request's state is destroyed.
ConfigurationInclude the Psalm type fixture in the analyzed project files so the context value generics are checked.
DocumentationDocument the new budget, cause, values-only codec, and typed-value APIs, and update release notes and review guidance.
TestsCover context cause and budget behavior, value propagation and typing, pending-request cleanup, and the values-only codec and budget parser.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Wave 2 of the 2026-11-20 code-quality review.
Context::budgetMs(): ?int— remaining budget in whole ms (min 1), read before the active check;WireCodec::encode()uses it.Context::cause(): ?TerminationCause— why a context ended, observing pending requests and the deadline.WireCodec::encodeValues()/decodeValues()— values only, for transports that carry the deadline themselves;encode()/decode()are built on them.WireCodec::budgetFromWire()— the single incoming-budget rule, socontext-http's budget header can share it (Use a single rule for validating the budget header context-http#17). Accepted input unchanged.withValue()/value()(class-string<T>→T|null), pinned by a psalm type fixture intests/Types(red without the annotations). The runtime key check stays behind a private helper so psalm does not call it redundant and rector does not inline it.Context::$parentlink and its fallback removed.ContextState::__destruct()gives the pending-request counter back when a state is collected with an unobserved request; seconds→ns conversion is one private helper.Local mutation (
--with-uncovered,zend.assertions=-1): MSI 94% (gate 90). Lazy rollouts: none needed (all already in place).Fixes #23
Fixes #24
Fixes #25
Fixes #26
Fixes #28
Fixes #29
Summary by Sourcery
Improve context budgeting, termination inspection, typed values, and transport serialization for the 0.5.0 release.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: