Method names that do not start with a verb, text still describing a remote by a gateway id, and code written twice
### Problem/Motivation
A whole-module sweep found code that does not follow the naming rule the rest of the module follows (a method name starts with a verb), docblocks naming methods that have since been renamed, and one block of logic written twice.
**Methods whose name is not a verb**
- `NoticeSecrets::stateKey()` and `RemoteTokenProvider::stateKey()` (kessai_client)
- `RemotePayment::string()` and `RemoteMovement::string()` (kessai_client)
- `PaymentClientResolver::first()`
- `RefusedException::inside()`
- `OnwardUrl::redirect()`
- `SimulatorCheckoutForm::title()`, the route's title callback
Hook implementations, entity and form callbacks named by core (`runtime()`, `cron()`, `exists()`), the named constructors already kept on purpose (`PaymentDeadline::never()`, `siteDefault()`), `with*()` and `to*()`/`from*()` stay.
**Docblocks naming methods that are not there**
- `PaymentEngine` names `self::assertGateway()`, renamed `assertAccount()`.
- `PaymentRequest` says it is "everything `self::create()` needs". `create()` is on `PaymentClientInterface`.
- Test docblocks name `self::serializePayments()` (`WireFormatTest`), `self::deleteStoredTokens()` (`DetachedPaymentContractTest`) and `self::assertAmount()` (`PaymentEngineTest`). None of these test classes has that method. `WorldlinePaymentHandlerTest` names `PaymentInterface::setTokenValidUntil()`, which is on `PaymentEntityInterface`.
**The same accessors twice**
`RemotePayment` and `RemoteMovement` are two readers over a decoded array, and they carry the same code: `id()`, `getAmount()`, `getCurrency()`, `getReference()` and the private reader they all call. A duplication detector reports it as a 38-line clone.
**Text that still describes the model before payments named an account by its uuid**
A consumer used to name a remote by its id, as a "gateway id". Since payments name the account by its uuid, the remote is found by the account uuid the handshake recorded, and its id is only the config entity's machine name. Several places still say otherwise:
- The remote form's id description tells an operator it is "the gateway id a module names when it asks for a payment".
- The remote form's **Enabled** description says "The ones already taken through it are still settled, because they name it". That is false: a disabled remote is not found by `RemoteLookup::findRemoteByAccount()`, so settling one of its payments is refused, which docs/remote.md describes as intended ("A disabled remote answers nothing").
- The remote listing has a "Gateway id" column, and the config schema labels the id "The id a consumer names as its gateway".
- The docblocks of `Remote`, `RemoteLookup` and `RemotePaymentClient` say the same, and `RemoteLookup::findRemote()` has no caller left.
- `PaymentClientInterface` says "Today one class answers it", but `RemotePaymentClient` answers it too. It calls an account uuid "the word it passed as the gateway", says accounts are "keyed by id" where it means by uuid, and says "the same gateway" where reuse compares the account. docs/architecture.md says "the same gateway" twice too.
- The account listing's column reads "Uuid", where core writes "UUID".
**One more list written out twice**
`PaymentAuditTrailSubscriber::getSubscribedEvents()` names the nine events by hand, where `PaymentNotifier` reads `PaymentEvents::getEventNames()` so that an event added to the contract is not missed.
### Proposed resolution
- Rename: `getStateKey()`, `readString()`, `getFirstClient()`, `findInside()`, `buildRedirect()`, `getTitle()`. Callers, the routing file and the docs follow. Nothing outside kessai calls these, and kessai is pre-1.0, so there is no deprecation step.
- Point each stale docblock at the method that exists.
- Move the shared accessors and the reader into one trait used by both remote records.
- Correct the remote form, listing, schema label and docblocks to say what the id is (this site's machine name for the remote) and what disabling does (its payments are no longer reached), with the French catalog following. Delete `RemoteLookup::findRemote()`.
- Correct the contract and architecture docs to say account and uuid where they still say gateway and id. Write "UUID".
- Subscribe the audit trail to `PaymentEvents::getEventNames()`.
### Remaining tasks
- Implement. phpstan sweeps the renames. These are names, text and a move, with no behavior change, so no new test: the existing suites cover the moved code and the event list.
### User interface changes
None.
### API changes
`RefusedException::inside()` becomes `findInside()`, and `OnwardUrl::redirect()` becomes `buildRedirect()`.
### Data model changes
None.
AI-Generated: Yes (Claude Code was used to help draft this issue summary. I reviewed it.)
issue
GitLab AI Context
Project: project/kessai
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/kessai/-/raw/1.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/kessai
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD