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) and labeled (15 to 1). The -ing form of cancel is deliberately left: core is 17 to 1 the other way there. StatusCatalogue was British and invented, so it is StatusRepository, core's word for "which of these are available here".
  • Hook classes. Core's Hook/ directories hold 371 classes ending Hooks against 15 ending Hook. Ours were 8 of 34. All 34 now take the extension-plus-topic-plus-Hooks shape, which also retires GatewayTypeHealer.
  • 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_cron methods, which core spells cron() every time.
  • Core's verbs. explain() is summary() (core's own ConditionInterface declares exactly that). OrchestraReturn's remember/recall/forget triple is core's set()/get()/delete(). DeadlineStateInterface::forget() is delete(); RemoteTokenProvider::forget() is reset().
  • Money. orchestra_payment spent amount 69 times and figure 43 times on one axis. formatAmount(), shownAmount(), claimsShownAmount(), pendingPaymentFor(), and the two locals now read $shown and $priced so the comparison says what it tests.
  • Config conversion. Four spellings became one pair, toConfig()/fromConfig(). project is the word Drupal keeps for a drupal.org project: all 59 Project* identifiers in core are that noun.
  • Subscribers. Seven classes in EventSubscriber directories now end Subscriber, as core's 111 do.
  • snake_case. The config keys flowLabels/nodeLabels and 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, TaskDisposition to TaskDecision, 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,DrupalPractice over the module root: 0 errors, and the single warning 1.x already had.
  • phpstan level 3: [OK] No errors. It caught three things phpcs could not: two .install files outside the sweep, a sweep() 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.)

Merge request reports

Loading
Loading