Problem/Motivation
Every Yoyaku submodule is meant to be separable, yet two of them name a class from a module they do not declare:
yoyaku_calendarnamesDrupal\yoyaku_payment\PaymentPolicyResolverInterfaceinAvailabilityFeedandSlotBookingForm, to show a price.yoyaku_orchestranamesDrupal\yoyaku_manager\ResourceAccessInterfacein itsresource_managersaudience, to resolve a resource's managers.
Both work today only because PHP resolves a nullable parameter type lazily, so an optional service typed on an absent module's interface holds right up to the moment a value is passed. Shipped apart, they would fatal.
A third case named in the first draft, yoyaku_placement constructing yoyaku_cart's CartCheckoutEvent, is already resolved: the controller asks the engine's BookingCartInterface and links the cart by route name, which is a string and degrades on its own.
Proposed resolution
Keep both integrations optional without naming an undeclared class. The engine owns a narrow seam interface, Drupal\yoyaku\PriceResolverInterface, which PaymentPolicyResolverInterface extends, so the calendar names only the engine's. The audience exists for one integration and nothing else, so its home is a yoyaku_orchestra_manager bridge submodule depending on both sides, following yoyaku_orchestra_order and yoyaku_payment_orchestra; its guard goes with the move, since a guard that answers with nobody is worse than none.
Remaining tasks
- A check that fails when a submodule names a class from a module it does not declare, transitively, over shipped code only.
AI-Generated: Yes (Claude Code was used to help draft this issue summary and to write the code and tests on the merge request. I reviewed and ran the work myself before posting it.)
Issue fork yoyaku-3616250
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
Comment #3
mably commentedComment #4
mably commentedComment #6
mably commented