One word carried three unrelated meanings in this codebase, and the busiest of them spanned three types, one of which had no type at all.

The three meanings

A line of text. A section's subsection names are entered one per line; a ticket template's lines each become a ticket.

A line on the map. The venue inventory report describes a row numbered along itself as "a line that runs the length of the row".

One item of an order. This is the one that hurts, and everything below is about it alone.

The order-line sense was three types wearing one word

HoldLine is the ask: a slot, a tariff, a quantity, the fields a submodule attached. A booking line is a saved Booking. The third had no type at all: PolicyContext::lines() returned a plain list of string-keyed arrays, the two above merged, so every constraint policy read it defensively because nothing said what was in it.

What landed

The ask is BookingAsk. The merged shape is two types behind one interface, which turns the hand-written discrimination into a type check and removes the defensive reads. The word is gone from the PHP, the docs, the French catalog, the module READMEs, the YAML, the Twig and the JS; the text and map senses survive, which is why this could not be a sweep on the bare word.

Retiring it exposed more, so the issue grew to cover it.

The engine reshape. RequestBooker merged into BookingManager, so a surface talks to one service. One hold() rather than four, because the intent now rides on the ask. One result type, BookingResult. Every refusal throws.

A naming pass, measured against core rather than argued. No method in core ends in On(), so that suffix is banned here. make* is not core's construction prefix: create* appears 205 times in core's lib alone, while make* appears about twenty times in all of core and means to transform something that exists. Thirty-two get*() methods returned void, so they were commands wearing a getter's prefix. Ten traits began with a third-person verb, which none of core's 226 does.

Target is retired too. A target was a tariff id, or a "slot:<id>" token, and nothing in the name said so. 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.

Not in scope

The text and map senses of the word line. The entity-reference sense of target, the DOM's own target, and a grant's managed target.

This is a rewrite rather than a rename, and it breaks the constraint policy plugin API. The project is pre-1.0 and reinstall-only. No config schema key, base field or stored value moves, so no update path is needed.

AI-Generated: Yes (Claude Code found the three senses and the untyped seam, wrote the change and its tests, and ran the naming measurements against core. I reviewed the result, and the branch is green on every CI job.)

Issue fork yoyaku-3619145

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review
mably’s picture

Title: Retire the order-line sense of line: the ask becomes BookingAsk, the record stays Booking » Retire the words line and target, and name what is left the way core does
Issue summary: View changes

  • mably committed 52954c7d on 1.x
    task: #3619145 Retire the words line and target, and name what is left...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.