Retire the words line and target, and name what is left the way core does
Ready for review. Seventy commits, every one of them CI-green; the head pipeline is green on every job, phpcs and cspell included, both of which are allow_failure here and so have to be read job by job rather than off the badge.
One word carried three unrelated meanings, and the busiest of them spanned three types, one of which had no type at all. Retiring it turned into a vocabulary and naming pass over the whole module.
The order-line sense is gone
HoldLine is BookingAsk, and the merged untyped shape the constraint policies read is now two types behind one interface, so a policy can ask the same question before and after the write. TransactionLookup's readers, and the OrderManagerInterface facade with them, say booking.
The word is gone from the PHP, the docs, the French catalog, the module READMEs, the YAML comments, the Twig and the JS. The text and map senses survive untouched, which is why this could not be a sweep on the bare word.
Two of my own filters hid work from me and are worth naming: the corpus scanned src modules tests only, so yoyaku.api.php — the file a module author reads first — was never looked at; and per line was excluded as boilerplate, which hid fifty-odd comments that meant per booking.
The engine reshape that fell out of it
RequestBooker is merged into BookingManager, so a surface talks to one service. There is one hold() rather than four, because the intent now rides on the ask. There is one result type, BookingResult. Every refusal throws. say() is gone.
Naming, measured against core rather than argued
On()is banned: not one method in all of core ends in it. The prepositions core does end with always follow a verb (getBundleOf(),getMetadataFor(),applyTo()), so the defect was never the preposition but the missing verb.make*is not the construction prefix:create*appears 205 times in core'slibalone andmake*about twenty in the whole of core, where it means transform something that exists. All thirteen here construct.- Thirty-two
get*()methods returnedvoid, so they were commands wearing a getter's prefix. Every docblock already said the verb. - Ten traits began with a third-person verb. None of core's 226 does.
- A name must match its return type. Grepping
create|build|make X(): TagainstTcaught two that lied.
target is retired too
A target was a tariff id, or a slot:<id> token. Nothing in the name said so, and Drupal already means the referenced entity of a reference field by that word — a sense this module also uses. What a booker steps is an offer, so an offer now has an id: data-offer-id, offer.id, {offer, quantity} on the request.
Worth knowing while reading
getField()is why the policy seam is an interface rather than a phpstan array shape: an ask's fields are spread intoBooking::create(), soOrphanedPlacesno longer skips every saved booking.- Measured over 10k of each: the old arrays cost 403 bytes apiece, the wrappers 96 and 139.
- Twenty-two defensive guards left the readers and none came back.
- The engine is untouched by the vocabulary: no config schema key, base field or stored value moved, so this needs no reinstall.