The hook that drops what a booking change invalidates is named after only one of the things it drops

forgetPolicyOutcomes() had come to drop two things: the resolved policy outcomes it was named for, and the basket lines a request keeps, added in [#3615974]. The name admitted one of them, so reading it to find out what a change invalidates gave half an answer, and the next thing needing the same treatment had nowhere obvious to go.

It is now forgetStaleAnswers(): named for the rule rather than for either member, so the next thing worked out from a basket and kept belongs here without the name having to be wrong first. Nothing outside the class called it, and the #[Hook] attributes carry the real hook names, so the method name was free.

Two things the docblock now says that it did not:

  • Both members are answers worked out once and kept for the length of a request, which is the property that makes a change invalidate them.
  • Answers rather than writes. The hook runs on yoyaku_booking_delete as readily as on an insert, and a line that has gone invalidates as much as one that has arrived, so naming it after writing would have been wrong in a third of its cases.

The per-member reasoning is kept rather than dropped: why the policy evaluation is remembered at all, which shipped test fails without it, and why attachment hosts are deliberately left out.

No behaviour change, no test touched, nothing else in the codebase referred to the old name.

Merge request reports

Loading
Loading