Issue #3618935: Name things the way Drupal core does: canceled over cancelled, core's *Hooks suffix, summary() over explain(), delete() over forget()
This is the merge request for [#3618935].
Every candidate word was counted against a corpus of 24,173 identifiers taken from core's class, interface, trait, enum and method names in core/lib and core/modules. A word with zero hits in core is an invention; an invention is only a defect where core already has a word for the same thing.
What changed, commit by commit
- Spelling.
canceled(core: 45 to 9),signaled/signaling(core has no British form at all) andlabeled(15 to 1). The-ingform of cancel is deliberately left: core is 17 to 1 the other way there.StatusCataloguewas British and invented, so it isStatusRepository, core's word for "which of these are available here". - Hook classes. Core's
Hook/directories hold 371 classes endingHooksagainst 15 endingHook. Ours were 8 of 34. All 34 now take the extension-plus-topic-plus-Hooksshape, which also retiresGatewayTypeHealer. - Hook methods. Core names 1106 of its 1208 hook methods after the hook they implement; we named 25 of 53. All 53 do now, including both
hook_cronmethods, which core spellscron()every time. - Core's verbs.
explain()issummary()(core's ownConditionInterfacedeclares exactly that).OrchestraReturn's remember/recall/forget triple is core'sset()/get()/delete().DeadlineStateInterface::forget()isdelete();RemoteTokenProvider::forget()isreset(). - Money.
orchestra_paymentspentamount69 times andfigure43 times on one axis.formatAmount(),shownAmount(),claimsShownAmount(),pendingPaymentFor(), and the two locals now read$shownand$pricedso the comparison says what it tests. - Config conversion. Four spellings became one pair,
toConfig()/fromConfig().projectis the word Drupal keeps for a drupal.org project: all 59Project*identifiers in core are that noun. - Subscribers. Seven classes in
EventSubscriberdirectories now endSubscriber, as core's 111 do. - snake_case. The config keys
flowLabels/nodeLabelsand nine camelCase parameters on our own signatures. Promoted constructor properties stay lowerCamel, which is the distinction that makes this not a blind sweep. - Smaller. The one permission that did not name the module,
TaskDispositiontoTaskDecision, four traits, the Material Design "chips", and two opaque private helpers.
Documentation and the French translations move in the same MR. In the .po files only msgid lines take the spelling change; the three exceptions are where a machine name is quoted inside the translation and has to keep matching what the code emits.
Deliberately not done
act, and the 364 bare-noun accessors, are recorded on the issue as decisions rather than renames.
Four more were dropped after reading the code rather than the name: drain, sweep, landing, inert, cohort, qualify and catchUp each turned out to be consistent, load-bearing vocabulary tied to a shipped config key, a CSS class, a base field or an XML term. PaymentManagerInterface::forgetCard() is kessai's API and is untouched here.
Verification
- phpcs
--standard=Drupal,DrupalPracticeover the module root: 0 errors, and the single warning1.xalready had. - phpstan level 3:
[OK] No errors. It caught three things phpcs could not: two.installfiles outside the sweep, asweep()call renamed along with the method that delegates it, and one place the spelling crossed into kessai's API. - cspell over the changed files adds no new unknown word.
- Kernel classes covering the renamed hooks, the return store and the migration preview run green: 25 tests, 297 assertions.
The full suite is left to CI.
AI-Generated: Yes (Claude Code ran the audit and wrote these renames. I reviewed the work before posting it.)